#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main(){
  int n,a[100000],b[100000];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[n-1-i]=a[i];
  }
  map <int,int> x,y;
  vector <int> re;
  for(int i=0;i<n;i++){
    x[a[i]]++;
    y[b[i]]++;
    if(x==y) re.push_back(i+1);
  }
  for(int i=0;i<(int)re.size();i++){
    if(i) cout<<" ";
    cout<<re[i];
  }
  cout<<endl;
  return 0;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

problem

Given a sequence $ a_i $ of length $ N $. Output all integers $ K (1 \ le K \ le N) $ that satisfy the following conditions.

Condition: Well sorted $ a_1, \ cdots, a_K $ matches $ a_ {N-K + 1}, \ cdots, a_N $.





Example

Input

8
5 2 4 9 4 9 2 5


Output

1 2 4 6 7 8

### Response

```cpp
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main(){
  int n,a[100000],b[100000];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[n-1-i]=a[i];
  }
  map <int,int> x,y;
  vector <int> re;
  for(int i=0;i<n;i++){
    x[a[i]]++;
    y[b[i]]++;
    if(x==y) re.push_back(i+1);
  }
  for(int i=0;i<(int)re.size();i++){
    if(i) cout<<" ";
    cout<<re[i];
  }
  cout<<endl;
  return 0;
}

```