MAY99_E1 - Letter Count

In this problem, you will be given a string of less than 1000 characters. The string will contain uppercase and lowercase letters.

Your task is to print the character appearing with maximum frequency. If there are more than 1 such character, print the one with lower ASCII value

Consider lowercase letters as different from uppercase letters, i.e. 'a' is different from 'A'.

Input

Single line containing the string

Output

The character occurring most number of times in the string.

Example

Input 1:
abcdabcdaaaa

Output 1:
a
Input 2:
abcAbcAbcabc

Output 2:
b
Input 3:
aDDa

Output 3:
D

Added by:Mayank Tuteja
Date:2013-01-17
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ASM32-GCC MAWK BC C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JAVA JS-MONKEY JULIA KTLN NIM OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET

hide comments
2023-01-30 18:45:54
too easy question.. I could solve it even in my dreams
2022-06-19 06:38:41
AC in one go
2017-02-10 10:08:56
do we need to enter the number of test cases??
2015-09-07 23:50:56
ruby?????
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.