# Function to validate if the input is numeric
def is_numeric(input_data):
    try:
        int(input_data)
        return True
    except ValueError:
        return False

# Input for the number of emergency shipments
n = input("Enter the number of emergency shipments: ")

if not n.isdigit():
    print("Invalid input")
else:
    n = int(n)
    emergency_shipments = []

    # Input emergency shipment quantities
    for _ in range(n):
        quantity = input("Enter emergency shipment quantity: ")

        if not is_numeric(quantity):
            print("Invalid input")
            break
        else:
            emergency_shipments.append(int(quantity))
    else:
        # Reverse the order and print the output
        print(" ".join(map(str, reversed(emergency_shipments))))