Problem C
Musical Chairs
Professor O’Dagio of the music department at Faber College
has come up with a rather interesting way of selecting its
department chair. All
The next person in line then calls out his or her favorite
opus number (this becomes the new value of
For instance, suppose the professors are numbered
( |
( |
( |
( |
|
|
|
|
|
Professor (
|
( |
( |
( |
||
|
|
|
Professor (
|
|
( |
( |
|||
|
|
Professor (
|
||
( |
||||
|
Professor (
|
Input
The first line of input contains an integer
Output
Output the number of the new department chair.
Sample Input 1 | Sample Output 1 |
---|---|
4 8 2 4 2 |
3 |