import java.util.HashSet;
import java.util.Iterator;
/**
* @author YuanJie
* @description:
* @ClassName Main
* @date 2022/3/11 17:57
*/
import java.util.Scanner;
import java.util.TreeSet;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int number = sc.nextInt();
int[] arr = new int[number];
for(int i=0;i<number;i++) {
arr[i]=sc.nextInt();
}
TreeSet<Integer> s =new TreeSet();
if(arr[0]!=arr[1]) {
s.add(arr[0]);
}
for(int i=1;i<number-1;i++) {
if(arr[i]==arr[i+1]||arr[i]==arr[i-1]) {
i++;
continue;
}
s.add(arr[i]);
}
if(arr[number-1]!=arr[number-2]) s.add(arr[number-1]);
for(Integer i:s) {
System.out.print(i+" ");
}
}
}
02-11
2万+
08-15
2759