import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
// while (in.hasNextInt()) { // 注意 while 处理多个 case
// int a = in.nextInt();
// int b = in.nextInt();
// System.out.println(a + b);
// }
while (in.hasNextLine()) {
String s = in.nextLine();
char[] cs = s.toCharArray();
int len = cs.length;
int max = 0;
List<String> results = new ArrayList<>();
String temp = "";
int count = 1;
for (int i = 0; i < len; i++) {
char c = cs[i];
if (Character.isDigit(c)) {
temp += c;
if (i < len - 1 && Character.isDigit(cs[i + 1])) {
count++;
} else {
if (max == count) {
results.add(temp);
} else if (max < count) {
results.removeAll(results);
max = count;
results.add(temp);
}
count = 1;
temp = "";
}
}
}
for (int i = 0; i < results.size(); i++) {
System.out.print(results.get(i));
}
System.out.println("," + max);
}
}
}