import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            String input = scanner.nextLine() + "$";
            int count = 0;
            int max = 0;
            List<Integer> startingPoints = new ArrayList<>();
            int tempRemeber = -1;
            for (int i = 0; i < input.length(); i++){
                if (input.charAt(i) >= '0' && input.charAt(i) <= '9'){
                    if (tempRemeber == -1){
                        tempRemeber = i;
                    }
                    count += 1;
                }else{
                    if (count == max){
                        startingPoints.add(tempRemeber);
                    }else if (count > max){
                        max = count;
                        startingPoints.clear();
                        startingPoints.add(tempRemeber);
                    }
                    tempRemeber = -1;
                    count = 0;
                }
            }
            StringBuilder result = new StringBuilder();
            for (Integer i : startingPoints){
                result.append(input.substring(i, i + max));
            }
            result.append("," + max);
            System.out.println(result.toString());
        }
    }
}