LearnPy Hub
← Arena
EasyRating 1000

Longest Same-Letter Run

Find the longest block of the same character in a row. Print the character and the length. If there's a tie, use the block that appears first.

Input

One word.

Output

The character and the length.

Sample 1

Input
aabbbcc
Output
b 3

Sample 2

Input
abc
Output
a 1
solution.py
Output appears here
Longest Same-Letter Run · Python Arena problem · LearnPy Hub