#include using namespace std; const int N = 200010; int n, cnt; int a[N]; bool st[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); while (cnt < n) { int last = 2; for (int i = 1; i <= n; i++) { if (!st[i] && a[i] != last) { last = a[i]; st[i] = true; printf("%d ", i); cnt++; } } puts(""); } return 0; }