#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;
  vector<int> a,b;
  int n;

  cin >> n;
  a.resize(n);
  b.resize(n);
  for(ii=0;ii<n;ii++){
    cin >> a[ii];
  }
  long long int prev = 10e9 +1;
  int pos;
  pos = 0;
  for(ii=0;ii<n;ii++){
    if(prev != a[ii]){
      b[pos] = a[ii];
      pos++;
    }

    prev = a[ii];
  }

  vector<int>::iterator it = b.begin();

//  while(it != b.end()){
//    cout << *it;
//    it++;
//    if(it != b.end()){
//      cout << " ";
//    }
//    else{
//      cout << endl;
//    }
//  }
  for(ii=0;ii<pos;ii++){
    cout << b[ii];
    if(ii != pos -1){
      cout << " ";
    }
  }
  cout << endl;
  
  return 0;
}


### Prompt

Generate a CPP solution to the following problem:

For a sequence of integers $A = \\{a_0, a_1, ..., a_{n-1}\\}$ which is sorted by ascending order, eliminate all equivalent elements.

Constraints

* $1 \leq n \leq 100,000$
* $-1000,000,000 \leq a_i \leq 1,000,000,000$
* $a_0 \leq a_1 \leq ... \leq a_{n-1}$

Input

A sequence is given in the following format.


$n$
$a_0 \; a_1 \; ,..., \; a_{n-1}$


Output

Print the sequence after eliminating equivalent elements in a line. Separate adjacency elements by a space character.

Example

Input

4
1 2 2 4


Output

1 2 4

### Response

```cpp
#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;
  vector<int> a,b;
  int n;

  cin >> n;
  a.resize(n);
  b.resize(n);
  for(ii=0;ii<n;ii++){
    cin >> a[ii];
  }
  long long int prev = 10e9 +1;
  int pos;
  pos = 0;
  for(ii=0;ii<n;ii++){
    if(prev != a[ii]){
      b[pos] = a[ii];
      pos++;
    }

    prev = a[ii];
  }

  vector<int>::iterator it = b.begin();

//  while(it != b.end()){
//    cout << *it;
//    it++;
//    if(it != b.end()){
//      cout << " ";
//    }
//    else{
//      cout << endl;
//    }
//  }
  for(ii=0;ii<pos;ii++){
    cout << b[ii];
    if(ii != pos -1){
      cout << " ";
    }
  }
  cout << endl;
  
  return 0;
}


```