Today, Shubham is very busy with a string. He is observing the journey of each character of the string. Journey of a character in the string can be defined as the array of locations coordinates at which the character is present in the string.
For example in string "vivekanand"
Journey of 'v':- [0,2]
Journey of 'i':- [1]
Journey of 'e':- [3]
Journey of 'k':- [4]
Journey of 'a':- [5,7]
Journey of 'n':- [6,8]
Journey of 'd':- [9]
Journey of a character is said to be "marvellous" if the sum journey of the character is greater than sum journey of any other character in the string.
Sum journey of character in the string can be defined as the sum of all the location coordinates in its path.
Can you find the lexicographically smallest character whose journey is marvellous.
Input Format
The only line of input consists of a single string, S.
Constraints
1<= |S| <=1e9
String contains only Lowercase English alphabets.
Output Format
Print a character C which represents lexicographically smallest character whose journey is marvellous and an integer I which represents sum journey of the character space-separated.
Sample TestCase 1
Input
vivekanand
Output
n 14
Answers
Answered by
0
Answer:
It's a co\de. srakhdbbar
Explanation:
Similar questions
Math,
12 days ago
English,
12 days ago
Computer Science,
25 days ago
Social Sciences,
25 days ago
Business Studies,
9 months ago
Chemistry,
9 months ago
English,
9 months ago