From the provided array of integers, remove all duplicate elements, ensuring that only the element with the highest index is retained.
The first line contains the integer , representing the number of elements in the array. The second line contains integers, each with an absolute value not exceeding .
Print the array elements without duplicates in a single line, maintaining their original order, and separate them with spaces.
Example 1