#include<stdio.h>
int main() {
char str[201];
while (~scanf("%s", str)) {
int i = 0, j = 0, mlen = 0;
while (str[i]) {
if (str[i] >= '0' && str[i] <= '9') {
j = i + 1;
while (str[j] && str[j] >= '0' && str[j] <= '9')j++;
mlen = j - i > mlen ? j - i : mlen;
i = j;
}
else {
i++;
}
}
i = 0;
while (str[i]) {
if (str[i] >= '0' && str[i] <= '9') {
j = i + 1;
while (str[j] && str[j] >= '0' && str[j] <= '9')j++;
if (j - i == mlen)
while (i != j)
printf("%c", str[i++]);
else
i = j;
}
else {
i++;
}
}
printf(",%d\n", mlen);
}
}