10035: ABC338 —— B - Frequency
[Creator : ]
Description
You are given a string $S$ consisting of lowercase English letters. Find the character that appears most frequently in $S$. If multiple such characters exist, report the one that comes earliest in alphabetical order.
Input
The input is given from Standard Input in the following format:
```
$S$
```
```
$S$
```
Output
Among the characters that appear most frequently in $S$, print the one that comes earliest in alphabetical order.
Constraints
- $1 \leq |S| \leq 1000$ ($|S|$ is the length of the string $S$.)
- Each character in $S$ is a lowercase English letter.
- Each character in $S$ is a lowercase English letter.
Sample 1 Input
frequency
Sample 1 Output
e
Sample 2 Input
atcoder
Sample 2 Output
a
In frequency, the letter e appears twice, which is more than any other character, so you should print e.In atcoder, each of the letters a, t, c, o, d, e, and r appears once, so you should print the earliest in alphabetical order, which is a.
Sample 3 Input
pseudopseudohypoparathyroidism
Sample 3 Output
o