Problem C
Úllen dúllen doff
Languages
en
is
Stefán Valur Hansson, also known as Svalur Handsome, is going on an exciting adventure and can bring a single friend with him. He doesn’t want to hurt his friends’ feelings so he decides to use a mantra to choose someone randomly to bring with him. He asks his $n$ friends to meet him and line up. He starts by pointing at his friends that’s furthest to the left and says the first word of the mantra. For each word he says he moves his finger to point at the next person to the right. If he is already at the right-most person he moves back to the front of the line.
The mantra is as follows:
Úllen dúllen doff kikke lane koff koffe lane bikke bane úllen dúllen doff.
Can you say which friend will be chosen?
Input
The input is two lines. The first line contains a single integer $1 \leq n \leq 100$, the number of friends. The second line contains the names of Stefán’s friends, separated by spaces. The names are unique, contain only English letters and each name is at most $10$ characters.
Output
Print the name of the friend that gets chosen.
Stigagjöf
Group |
Scoring |
Constraints |
1 |
100 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
6 Arnar Atli Bjarni Bjarki Hannes Unnar |
Arnar |
Sample Input 2 | Sample Output 2 |
---|---|
15 Z X Y A B C P Q R S T U V W O |
V |