#include<bits/stdc++.h>
using namespace std;
const int Max=2e5+5;
priority_queue<int,vector<int>,greater<int> > q;
pair<int,bool> f[Max];
bool mark;
int n,t;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&f[i].first);
q.push(1);
f[1].second=true;
t=1;
f[0].first=2;
int m=n-1;
while(m>0){
if(mark) t=0;
for(int i=2;i<=n;i++){
if(!f[i].second&&f[t].first!=f[i].first){
m--;
q.push(i);
f[i].second=true;
t=i;
}
}
while(!q.empty()){
printf("%d ",q.top());
q.pop();
}
putchar('\n');
mark=true;
}
return 0;
}
TLE后三个点