import sys

while True:
    try:
        a= input().split(' ')
        n = len(a)
        cnt =0
        b=''
        c=[]
        start='"'
        end ='"'
        flag =True
        for i in range(n):
            if flag:
                if a[i].startswith(end) and not a[i].endswith(start):
                    flag = not flag
                    b+=a[i]
                else:
                    c.append(a[i])
                    cnt+=1
            else:
                if not a[i].startswith(start) and a[i].endswith(end):
                    flag = not flag
                    b+=' '+a[i]
                    c.append(b)
                    cnt+=1
                else:
                    b =b+' '+a[i]
        print(str(cnt))
        for i in c:
            print(i.strip('"'))      
    except:
        break