B - 多数決 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MB

配点 : 8

注意

この問題に対する言及は、2020年5月2日 18:00 JST まで禁止されています。言及がなされた場合、賠償が請求される可能性があります。

試験後に総合得点や認定級を公表するのは構いませんが、どの問題が解けたかなどの情報は発信しないようにお願いします。

問題文

ある国で選挙が行われました。候補者は a, b, c の 3 名です。

投票されたすべての票を表す文字列 S が与えられます。S は英小文字 a, b, c からなり、Si 文字目は i 番目の投票者が投票した候補者を表します。最多得票を得た候補者は誰か求めてください。

なお、最多得票を得た人物はちょうど 1 名であることが保証されています。

制約

  • 1 \leq |S| \leq 1000
  • Sa, b, c からなる文字列である
  • 最多得票を得た人物はちょうど 1 名

入力

入力は以下の形式で標準入力から与えられる。

S

出力

最多得票を得た候補者を表す英小文字を出力せよ。


入力例 1

abbc

出力例 1

b

候補者 a が 1 票、b が 2 票、c が 1 票を得ました。最多得票者は b です。


入力例 2

cacca

出力例 2

c

候補者 b は 1 票も得られませんでした。


入力例 3

b

出力例 3

b

投票を行ったのは 1 人だけで、その人は b に投票したため、最多得票者は b です。


入力例 4

babababacaca

出力例 4

a

Score : 8 points

Warning

Do not make any mention of this problem until May 2, 2020, 6:00 p.m. JST. In case of violation, compensation may be demanded.

After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).

Problem Statement

A country held an election. There were three candidates: a, b, and c.

Given is a string S representing all the votes cast. S consists of the lowercase English letters a, b, and c, and the i-th character of S represents the candidate the i-th voter voted for. Find the candidate who received the most votes. It is guaranteed that there was exactly one candidate who received the most votes.

Constraints

  • 1 \leq |S| \leq 1000
  • S consists of a, b, and c.
  • There was exactly one candidate who received the most votes.

Input

Input is given from Standard Input in the following format:

S

Output

Print a lowercase English letter representing the candidate with the most votes.


Sample Input 1

abbc

Sample Output 1

b

The candidates a, b, and c received 1, 2, and 1 vote(s), respectively. Thus, b received the most votes.


Sample Input 2

cacca

Sample Output 2

c

The candidate b received no votes.


Sample Input 3

b

Sample Output 3

b

There was only one voter, and that person voted for b. Thus, b received the most votes.


Sample Input 4

babababacaca

Sample Output 4

a