import re

# Input number of visitors
n = int(input())

# Initialize the visitor list
visitor_list = []

# Read visitor names
for i in range(n):
    name = input().strip()
    
    # Check for special characters using regex
    if not re.match("^[A-Za-z0-9 ]+$", name):
        print("Invalid input")
        exit()
    
    # Add to the tail of the list
    visitor_list.append(name)

# Print the list in order
print(" ".join(visitor_list))