res = [] while True: try: n = input() res.extend(list(map(int,input().split()))) except: break print(int("".join([str(i) for i in sorted(list(set(res)))])))
res = [] while True: try: n = input() res.extend(list(map(int,input().split()))) except: break print(int("".join([str(i) for i in sorted(list(set(res)))])))