import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    //小易有一个长度为n序列，小易想移除掉里面的重复元素，
    //但是小易想是对于每种元素保留最后出现的那个。小易遇到了困难,希望你来帮助他。
    public static void main(String[] args) {
        Main solution = new Main();
        solution.function();
    }
    public void function(){
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt();
        int nums[]= new int[n];
        for (int i = 0; i < n; i++) {
            nums[i]=sc.nextInt();

        }
        ArrayList<Integer> list = new ArrayList<>();
        Set<Integer> set = new HashSet<>();
        for (int i = n-1; i >-1; i--) {
            if(!set.contains(nums[i])){
                list.add(nums[i]);
            }
            set.add(nums[i]);
        }
        for (int i = list.size()-1 ; i >0; i--) {
            System.out.print(list.get(i)+" ");
        }
        System.out.println(list.get(0));
    }
}
