import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.nextLine();
            String[] split = line.split("[^0-9]+");
            int max = Integer.MIN_VALUE;
            for (String s : split) {
                max = Math.max(max, s.length());
            }
            for (String s : split) {
                if (s.length() == max) {
                    System.out.print(s);
                }
            }
            System.out.print("," + max);
            System.out.println();
        }
    }
}