43A.md (1344B)
1 Source: https://codeforces.com/problemset/problem/43/A 2 3 A. Football 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 One day Vasya decided to have a look at the results of Berland 1910 Football Championship’s finals. Unfortunately he didn't find the overall score of the match; however, he got hold of a profound description of the match's process. On the whole there are *n* lines in that description each of which described one goal. Every goal was marked with the name of the team that had scored it. Help Vasya, learn the name of the team that won the finals. It is guaranteed that the match did not end in a tie. 22 23 Input 24 25 The first line contains an integer *n* (1 ≤ *n* ≤ 100) — the number of lines in the description. Then follow *n* lines — for each goal the names of the teams that scored it. The names are non-empty lines consisting of uppercase Latin letters whose lengths do not exceed 10 symbols. It is guaranteed that the match did not end in a tie and the description contains no more than two different teams. 26 27 Output 28 29 Print the name of the winning team. We remind you that in football the team that scores more goals is considered the winner. 30 31 Examples 32 33 Input 34 35 ``` 36 1 37 ABC 38 ``` 39 40 Output 41 42 ``` 43 ABC 44 ``` 45 46 Input 47 48 ``` 49 5 50 A 51 ABA 52 ABA 53 A 54 A 55 ``` 56 57 Output 58 59 ``` 60 A 61 ```