while True:

try:
    str_input = input()
    # 判断是否有引号
    if str_input.count('"') == 0:
        print(len(str_input.split()))
        for i in str_input.split():
            print(i)
    else:
        # 有引号时,先用引号分割
        list1 = str_input.split('"')
        # 再把第一个和最后一个用空格分割
        left_list = list1[0].split()
        right_list = list1[-1].split()
        
        new_list = left_list + list1[1: -1] + right_list

        print(len(new_list) - new_list.count('') - new_list.count(' '))
        for i in new_list:
            if i != '' or i != ' ':
                print(i)
    
except:
    break