#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, i = 1;
  vector<pair<int, int> > p;
  vector<int> x;
  vector<int> y;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &a);
    p.push_back(make_pair(a, i));
    i++;
  }
  sort(p.begin(), p.end());
  for (int c = 0; c < p.size(); c++) {
    if (c % 2 == 0) {
      x.push_back(p[c].second);
    } else {
      y.push_back(p[c].second);
    }
  }
  printf("%d\n", x.size());
  for (int e = 0; e < x.size(); e++) {
    printf("%d ", x[e]);
  }
  printf("\n%d\n", y.size());
  for (int e = 0; e < y.size(); e++) {
    printf("%d ", y[e]);
  }
  return 0;
}
