As part of the global effort to combat COVID-19, scientists are sequencing the genome of many samples that they find. Using this information, it is possible to trace how the virus evolves and how it spread, as well as helps in finding a cure.
As a simple model, the virus's genome can be represented by a string consisting of the letters
G. The difference between two strains ~X~ and ~Y~ is equal to the number of positions in which their genomes differ. A strain of the virus ~Z~ is to be an ancestor of ~X~ and ~Y~ if both the difference between ~X~ and ~Z~ and the difference between ~Y~ and ~Z~ is strictly smaller than the difference between ~X~ and ~Y~.
Given three sequences, determine if one of them is an ancestor of the other two.
The input begins contains three strings ~X, Y, Z~, the three sequences. All three strings are the same length of less than or equal to ~100~ characters.
Output one of the strings if it is an ancestor of the other two; or
Sample Input 1
ACTG CCTG CCTA
Sample Output 1
Sample Input 2
ACTG ATCG CTTG
Sample Output 2