total = int(input())
nums = list(map(int, input().split())) # Map to integers
unique_nums = sorted(set(nums)) # Remove duplicates and sort
print(len(unique_nums)) # Print the length of unique numbers
print(" ".join(map(str, unique_nums))) # Print sorted unique numbers