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

int main() {
    int N;
    cin >> N;

    vector<int> num(N);
    for (int i = 0; i < N; ++i) {
        cin >> num[i];
    }

    vector<int>::iterator result = unique(num.begin(), num.end());
    num.erase(result, num.end());

    for (int i = 0; i < num.size(); ++i) {
        cout << num.at(i);
        if (i < num.size() - 1) {
            cout << " ";
        }
    }
    cout << endl;

    return 0;
}
