# AOJ 0084 Search Engine

# Python3 2018.6.15 bal4u



import re



s = re.split('[., ]', eval(input()))

ans = []

for i in s:

	if len(i) >= 3 and len(i) <= 6:

		ans.append(i)

print((*ans))



# AOJ 0084 Search Engine

# Python3 2018.6.15 bal4u



import re



s = re.split('[., ]', eval(input()))

ans = []

for i in s:

	if 3 <= len(i) <= 6:

		ans.append(i)

print((*ans))



# AOJ 0084 Search Engine
# Python3 2018.6.15 bal4u
import re

s = re.split("[., ]", eval(input()))
ans = []
for i in s:
    if len(i) >= 3 and len(i) <= 6:
        ans.append(i)
print((*ans))

# AOJ 0084 Search Engine
# Python3 2018.6.15 bal4u
import re

s = re.split("[., ]", eval(input()))
ans = []
for i in s:
    if 3 <= len(i) <= 6:
        ans.append(i)
print((*ans))

-    if len(i) >= 3 and len(i) <= 6: +    if 3 <= len(i) <= 6: