#include <cctype>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s;
while (cin >> s) {
string temp, target;
int cnt = 0, max_cnt = 0;
for (char& c : s) {
if (isdigit(c)) {
++cnt;
temp += c;
} else {
if (max_cnt <
cnt) //当连续数字长度大于之前的最大数字长度,把要输出的字符串清空
target.clear();
max_cnt = max(max_cnt, cnt);
if (max_cnt ==
cnt) //最大数字字符串长度==当前最长数字字符串长度,把当前数字字符串加入到要输出的目标字符串中
target = target + temp;
cnt = 0;
temp.clear();
}
}
if (cnt > max_cnt) { //最后遍历的数字字符串长度>以往最大的数字字符串长度
max_cnt = cnt;
target = temp;
} else if (cnt == max_cnt) {//最后遍历的数字字符串长度==以往最大的数字字符串长度
target = target + temp;
}
cout << target << "," << max_cnt;
}
return 0;
}