# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
print("Hello world")
n, m = map(int, input().split())
costs = list(map(int, input().split()))

costs_a = {}
for cost in costs:
    if cost in costs_a:
        costs_a[cost] += 1
    else:
        costs_a[cost] = 1

possible_costs = []
for cost, count in costs_a.items():
    if count == n:
        possible_costs.append(cost)

print(*possible_costs)
