#include<iostream>
using namespace std;

int main()
{
    int n;

    cin >> n;

    int a[n];

    cin >> a[0];
    for( int i = 1; i < n; i++ )
    {   
        cin >> a[i];
        if( a[i-1] == a[i] )
        {
            i--;
            n--;
        }
    }

    for( int i = 0; i < n; i++ )
    {
        cout << a[i];
        if( i != n - 1 )
            cout << " ";
    }
    cout << endl;    

    return 0;
}
