import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String s = in.next();
            char[] arr = s.toCharArray();
            int len = s.length();
            int max = 0, cnt=0;
            boolean isDigit = false;
            int res = 0;
            List<String> list=new ArrayList<>();
            for (int i = 0; i < len; i++) {
                if (Character.isDigit(arr[i])) {
                    cnt++;
                    if(cnt>=max){
                        max=cnt;
                        list.add(s.substring(i-max+1,i+1));
                    }
                } else{
                    cnt=0;
                }
            }
            for(String str : list){
                if(str.length()==max){
                    System.out.print(str);
                }
            }
            System.out.println(","+max);
        }
    }
}