import re



s = re.split("[ .,]", input())

sl = len(s)

ans = list()



for i in range(sl) :

  if(2 < len(s[i]) and len(s[i]) < 7) :

    ans.append(s[i])

  else :

    pass



ansl = len(ans)



for i in range(ansl) :

  if(i == ansl - 1) :

    print(ans[i])

  else :

    print(ans[i], end = (" "))

import re



I = input().split()

S = []



for i in range(len(I)) :

    I[i] = re.split("[,.]", I[i])

    if 2 < len(I[i][0]) and len(I[i][0]) < 7 :

        S.append(I[i][0])



for i in range(len(S)) :

    if i == len(S) - 1 :

        print(S[i])

    else :

        print(S[i], " ", sep = "", end = "")

import re

s = re.split("[ .,]", input())
sl = len(s)
ans = list()
for i in range(sl):
    if 2 < len(s[i]) and len(s[i]) < 7:
        ans.append(s[i])
    else:
        pass
ansl = len(ans)
for i in range(ansl):
    if i == ansl - 1:
        print(ans[i])
    else:
        print(ans[i], end=(" "))

import re

I = input().split()
S = []
for i in range(len(I)):
    I[i] = re.split("[,.]", I[i])
    if 2 < len(I[i][0]) and len(I[i][0]) < 7:
        S.append(I[i][0])
for i in range(len(S)):
    if i == len(S) - 1:
        print(S[i])
    else:
        print(S[i], " ", sep="", end="")

-s = re.split("[ .,]", input()) -sl = len(s) -ans = list() -for i in range(sl): -    if 2 < len(s[i]) and len(s[i]) < 7: -        ans.append(s[i]) +I = input().split() +S = [] +for i in range(len(I)): +    I[i] = re.split("[,.]", I[i]) +    if 2 < len(I[i][0]) and len(I[i][0]) < 7: +        S.append(I[i][0]) +for i in range(len(S)): +    if i == len(S) - 1: +        print(S[i]) -        pass -ansl = len(ans) -for i in range(ansl): -    if i == ansl - 1: -        print(ans[i]) -    else: -        print(ans[i], end=(" ")) +        print(S[i], " ", sep="", end="")