Олимпиадный тренинг

Задача 38218. counting


Задача

Темы: Строки
The children decided to play catch-up, and in order to choose the driver, they stood in a circle and began to count. To do this, they used a counter. Pointing a finger in turn at each person standing in a circle, the counting utters one word, and the one who has the last word will lead. It is required to determine from this rhyme who will drive.

Input
The first line contains a counter. It consists of words written in Latin letters. The words are separated by one space. There are no punctuation marks, the line starts and ends with a letter. There are at least two words in the counter, and the length of the line does not exceed 100.

In the second line, in the same format, a list of schoolchildren's names is entered in the order in which they stand in a circle. Counting begins with the first student. There are at least two children, and the length of the string does not exceed 100.

Imprint
Print the name of the student who will drive.
 
# Input Output
1 To be or not to be
John Mary Ann Kate
Mary
2 Na zolotom kryltse sideli
Vasya Vasya Vasya
Vasya