import java.util.*;
import java.lang.String;
public class FindMaxConsecutive
{
public static char findMaxConsecutive(char[] arg)
{
char former = '0';
int max = 0;
int tempmax=0;
char maxone='0';
for (int i = 0;i < arg.length;i ++)
{
if(arg[i]==former)
tempmax+=1;
else
{
former=arg[i];
if(tempmax>max)
{
max=tempmax;
maxone=arg[i-1];
System.out.print(max+" ");
System.out.println(maxone);
}
tempmax=0;
}
}
return maxone;
}
public static void main(String args[])
{
//double consecutive = Double.parseDouble(args[0]);
//System.out.println(consecutive);
char[] c = args[0].toCharArray();
char maxConsecutive = findMaxConsecutive(c);
System.out.println(maxConsecutive);
}
}