#include<iostream>
#include<vector>
using namespace std;
vector <int> solve(vector <int> A){
    const int MAXN = 2*1e6;
    const int MAXA = 3*1e7;
    int N = A.size();
    int arr [MAXN];
    int index = 0;
    vector <int> ans;
    vector <int> indexi[MAXA];
    int point[MAXA];
    int kredit[MAXA];
    /*for(int i = 0; i < N; i ++){
        indexi[A[i]].push_back(i);
        point[A[i]] = 0;
    }
    for(int i = 0; i < N; i ++){
        if(kredit[A[i]] == -1){
            kredit[A[i]] = 0;
            continue;
        }
        kredit[A[i]] = -1;
        arr[index] = indexi[A[i]][point[A[i]]];
        arr[N - index - 1] = indexi[A[i]][point[A[i] + 1]];
        index ++;
        point[A[i]] += 2;
    }*/
    /*for(int i = 0; i < N; i ++){
        ans.push_back(i);
    }*/
    return ans;
}
