#include<bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

typedef long long ll;
typedef pair<int, int> P;

#define MAX 100005
#define INF 1001001001

int main(int, char**)
{
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  auto itr = unique(a.begin(), a.end());
  a.erase(itr, a.end());

  int as = a.size();
  rep(i,as) {
    cout << a[i];
    if (i==as-1) cout << endl;
    else cout << " ";
  }

  return 0;
}

