Favorite lucky number
Limits: 2 sec., 512 MiB
This statement was translated automatically from Ukrainian.
For Algotester’s birthday, let’s determine once and for all what your favorite lucky number is! 47 or 74?
To do this, a survey was conducted and \(n\) votes were collected, each vote can be either for 47 or for 74. Help count the votes and determine the winner.
Input
The first line contains a single integer \(n\) – the number of votes.
The second line contains \(n\) integers – the participants’ votes, each vote is equal to either 47 or 74.
Output
Output the winner: 47 if 47 received more votes, and
74 if 74 received more votes.
If the votes are split equally, output 4774.
Constraints
\(1 \le n \le 100\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 47 74 47 47 | 47 |
| Input (stdin) | Output (stdout) |
|---|---|
| 1 74 | 74 |
| Input (stdin) | Output (stdout) |
|---|---|
| 4 74 47 74 47 | 4774 |
Notes
In the first example, there were 3 votes for 47 and only 1 vote for 74. In the second example, there is a single vote for 74. And in the third example, the votes are split equally.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|