import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine()) != null){ int[] num = new int[str.length()]; int sum = 0; int max = 0; for(int i = 0;i < str.length();i++){ if(Character.isDigit(str.charAt(i))){ sum ++; if(max < sum){ max = sum; } num[i] = sum;

            }else{
                sum = 0;
            }
        }
        for(int i = 0;i< num.length;i++){
            if(num[i] == max){
                StringBuilder sb = new StringBuilder();
                for(int j = i - max +1;j <= i;j++){
                    sb.append(str.charAt(j));
                }
                System.out.print(sb.toString());
            }
        }
        System.out.println(","+max);
    }
}

}