# AOJ ITP2_4_D: Unique

# Python3 2018.6.24 bal4u



n = int(eval(input()))

a = list(map(int, input().split()))

ans = []

ans.append(a[0])

for i in range(1, n):

	if a[i] != a[i-1]: ans.append(a[i])

print((*ans))

# AOJ ITP2_4_D: Unique

# Python3 2018.6.24 bal4u



n = int(eval(input()))

a = list(map(int, input().split()))

print((*sorted(list(set(a)))))

# AOJ ITP2_4_D: Unique
# Python3 2018.6.24 bal4u
n = int(eval(input()))
a = list(map(int, input().split()))
ans = []
ans.append(a[0])
for i in range(1, n):
    if a[i] != a[i - 1]:
        ans.append(a[i])
print((*ans))

# AOJ ITP2_4_D: Unique
# Python3 2018.6.24 bal4u
n = int(eval(input()))
a = list(map(int, input().split()))
print((*sorted(list(set(a)))))

-ans = [] -ans.append(a[0]) -for i in range(1, n): -    if a[i] != a[i - 1]: -        ans.append(a[i]) -print((*ans)) +print((*sorted(list(set(a)))))