class HelloWorld {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String s = in.nextLine();
StringBuilder sb = new StringBuilder();
int c = 0;
int res = 0;
//第一次遍历先找到最长的数字串长度
//
for (int i = 0; i < s.length(); i++) {
if (Character.isDigit(s.charAt(i))) {
c++;
} else {
res = Math.max(c, res);
c = 0;
}
}
res = Math.max(c, res);
c = 0;
int start = 0, end = 0;
// 第二次遍历 遇到数字和最长的比较等于就拼接
for (int i = 0; i < s.length(); i++) {
if (Character.isDigit(s.charAt(i))) {
c++;
start = i;
end = i;
while (end < s.length() && Character.isDigit(s.charAt(end))) {
end++;
}
if ((end - start) == res) {
sb.append(s.substring(start, end));
} else {
i = end - 1;
}
}
}
System.out.println(sb.toString() + "," + res);
}
}