import re

while True:
    try:
        string = input()
        lists = re.findall('\d+', string)
        lens = max([int(len(x)) for x in lists])
        for i in lists:
            if len(i) == lens:
                print(i, end='')
        print(','+str(lens))
    except:
        break