Problem:
Unique For a sequence of integers $A = \{a_0, a_1, ..., a_{n-1}\}$ which is sorted by ascending order, eliminate all equivalent elements. Input A sequence is given in the following format. $n$
$a_0 \; a_1 \; ,..., \; a_{n-1}$ Output Print the sequence after eliminating equivalent elements in a line. Separate adjacency elements by a space character. Constraints  $1 \leq n \leq 100,000$  $-1000,000,000 \leq a_i \leq 1,000,000,000$  $a_0 \leq a_1 \leq ... \leq a_{n-1}$ Sample Input 1 4
1 2 2 4 Sample Output 1 1 2 4

Solution (Python):
from collections import Counter

n=input()
A=map( int , raw_input().split() )

D={}

for x in A:
	if x not in D:
		D[x]=1
		print x,
	else:
		pass

Solution (Python):
n = int(input())
a = list(map(int, input().split(' ')))

a = sorted(set(a))
print(' '.join(list(map(str, a))))

Solution (Python):


N = int(input())
A = list(map(int, input().split()))
A = list(set(A))
A.sort()
print(' '.join(map(str, A)))

Solution (Python):

def unique(li):
    """Returns a list of unique elements in ordered list li

    >>> unique([1, 1])
    [1]
    >>> unique([1, 2])
    [1, 2]
    """
    return [li[i] for i in range(len(li)) if i == 0 or li[i] > li[i-1]]


def run():
    n = int(input())
    li = [int(x) for x in input().split()]
    assert(n == len(li))

    print(" ".join([str(x) for x in unique(li)]))


if __name__ == '__main__':
    run()

Solution (Python):



n = int(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)

Solution (Python):



n = int(input())
a = list(map(int, input().split()))
print(*sorted(list(set(a))))

Solution (Python):

n = int(input())
a = list(map(int, input().split()))
print(*sorted(list(set(a))))

Solution (Python):
n = int(input())
A = sorted(map(int, set(input().split())))
print(" ".join(map(str, A)))

Solution (Python):
def solve():
    from sys import stdin
    f_i = stdin
    n = f_i.readline()
    A = f_i.readline().split()

    ans = (a1 for a1, a2 in zip(A, A[1:] + [None]) if a1 != a2)
    print(' '.join(ans))


solve()

Solution (Python):
def resolve():
    N = int(input())
    A = [int(i) for i in input().split()]
    a = set([A[0]])
    print(A[0], end="")
    for i in range(1, N):
        if A[i] not in a:
            print("", A[i], end="")
            a.add(A[i])
    print()


resolve()

Solution (Python):
n = int(input())
A = list(map(int, input().split()))

B = [A[0]]
for i in A:
    if B[-1] < i:
        B.append(i)

print(*B)

Solution (Python):
n = int(input())
b = list(map(int,input().split()))
a = list()
pre = 100100100
for bb in b:
  if bb != pre:
    a.append(bb)
    pre = bb
  
print(a[0],end="")
for aa in a[1:]:
  print(" {}".format(aa),end="")
print()

Solution (Python):
n = int(input())
a = sorted(list(set(list(map(int,input().split())))))
print (' '.join(map(str,a)))

Solution (Python):

from sys import stdin

n = int(stdin.readline())
l = list(stdin.readline().split())
l = list(dict.fromkeys(l))
print(' '.join(l))

Solution (Python):
input()
print(*sorted(set(list(map(int,input().split())))))

Solution (Python):
n = int(input())
*a, = map(int, input().split())
b = []
i = 0
while i < n:
    if i > 0 and a[i] == a[i-1]:
        i += 1
        continue
    b.append(a[i])
    i += 1
print(*b)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a = list(set(a))
print(*sorted(a))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
print(*sorted(list(set(a))))

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
s=list(set(l))
s.sort()
print(' '.join(map(str,s)))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

B = []
B.append(A[0])
for i in range(1, N):
    if A[i] != A[i-1]:
        B.append(A[i])
print(*B)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
print(*sorted(set(A)))

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A = list(dict.fromkeys(A))

print(*A)

Solution (Python):
n = int(input())
s = set()
a = []
for i in list(map(int, input().split())):
	if not i in s:
		a.append(i)
		s.add(i)
print(" ".join(map(str,a)))

Solution (Python):
def main():
    n = input()
    s = sorted(set(map(int, input().split(" "))))
    print(*s)
main()

Solution (Python):
m = input()
print(" ".join(list(dict.fromkeys(input().split()))))

Solution (Python):
n=int(input())
S=set(map(int, input().split()))
print(*sorted(list(S)))

Solution (Python):
n = input()
a = list(map(int,input().split()))
print(*list(dict.fromkeys(a)))

Solution (Python):
def solve():
    from sys import stdin
    f_i = stdin
    
    n = f_i.readline()
    A = f_i.readline().split()
    
    ans = (a1 for a1, a2 in zip(A, A[1:] + [None]) if a1 != a2)
    print(' '.join(ans))

solve()

Solution (Python):
n = int(input())

s = { int(x) for x in input().split()}

l = list(s)
l.sort()
print(*l)

Solution (Python):
n = int(input())
a = list(map(int, input().split( )))
a.append(20000000000)
ans = []
for i in range(0, n)[::-1]:
    if a[i] != a[i-1]:
        ans.append(a[i])
print(*reversed(ans))

Solution (Python):
if __name__ == "__main__":
    num_a = int(input())
    a = list(map(lambda x: int(x), input().split()))

    print(" ".join([str(elem) for elem in sorted(set(a))]))

Solution (Python):
n = int(input())
a = sorted(list(set((map(int, input().split())))))

print(*a)

Solution (Python):
N = int(input())
print(*sorted(set(map(int, input().split()))))

Solution (Python):

"""
Basic Modifications - Unique
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP2_4_D&lang=jp

"""
_ = input()
prev = float('-inf')
res = []
for a in input().split():
    a = int(a)
    if a > prev:
        res.append(a)
        prev = a
print(*res)

Solution (Python):
if __name__ == '__main__':

	n = int(input())
	A = set(map(int,input().split()))
	print(*sorted(list(A)))

Solution (Python):
n = int(input())

A = set(map(int, input().split()))

print(*sorted(list(A)))

Solution (Python):
n = int(input())
box = set(map(int, input().split()))
box = list(box)
box.sort()
print(*box)

Solution (Python):
input()
nums = list(map(int, input().split(' ')))

print(' '.join(map(str, sorted(set(nums)))))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
print(*sorted(list(set(a))))

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
A=sorted(list(set(A)))

print(' '.join(map(str,A)))

Solution (Python):



from collections import deque
import sys
input = sys.stdin.readline

def main():
    n1 = int(input())
    l1 = list(map(int,input().split()))
    print(*sorted(list(set(l1))))
if __name__ == '__main__':
    main()

Solution (Python):
input()
arr = sorted(list(set(map(int, input().split()))))
print(*arr)

Solution (Python):
n = int(input())
num = list(map(int, input().split()))

ans = list(set(num))
ans.sort()
print(' '.join(str(a) for a in ans))

Solution (Python):
N = int(input())
print(*sorted(set(map(int, input().split()))))

Solution (Python):
n = input()
li = set([int(i) for i in input().split()])
li = sorted(li)
print(" ".join(map(str, li)))

Solution (Python):
input(); print(*sorted(set(map(int, input().split()))))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a = sorted(set(a))
print(" ".join(map(str, a)))