#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> A(n);
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }
    auto r = unique(A.begin(), A.end());
    for (auto i = A.begin(); i != r; i++) {
        if (i != A.begin()) cout << " ";
        cout << *i;
    }
    cout << endl;
    return 0;
}
