#include <bits/stdc++.h>
using namespace std;

int n, x=1, temp=1;

int main() {
    cin >> n;
    int a[n];
    for (int i=0; i<n; i++) cin >> a[i];
    int b[n];
    for (int i=0; i<n; i++) b[i] = -1;
    b[0] = a[0];
    for (int i=1; i<n; i++) {
        if (a[i] == b[x-1]) temp =0;
        else {b[x] = a[i];
        x++;} temp = 1;
    }
    for (int i=0; i<x-1; i++) cout << b[i] << " ";
    cout << b[x-1] << endl;
} 
