import re

n = int(input())
tail = []  # Using the word 'tail' as per the instruction

for _ in range(n):
    name = input().strip()
    # Check for any special character using regex
    if not re.match("^[a-zA-Z0-9]+$", name):
        print("Invalid input")
        exit()
    tail.append(name)

print(" ".join(tail))