#include <bits/stdc++.h>
using namespace std;
const int inv = numeric_limits<int>::max();
const int minv = numeric_limits<int>::min();
const int max_n = 100000;
struct guy {
  int sk;
  int ix;
  guy() {}
  guy(int csk, int cix) {
    sk = csk;
    ix = cix;
  }
};
guy guys[max_n + 10];
struct guycmp : public binary_function<guy, guy, bool> {
  bool operator()(guy a, guy b) { return a.sk < b.sk; }
};
int n;
int main() {
  scanf("%d", &n);
  int csk;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &csk);
    guys[i] = guy(csk, i + 1);
  }
  sort(guys, guys + n, guycmp());
  printf("%d\n", ((n + 1) / 2));
  for (int i = 0; i < n; i += 2) printf("%d ", guys[i].ix);
  printf("\n");
  printf("%d\n", (n / 2));
  for (int i = 1; i < n; i += 2) printf("%d ", guys[i].ix);
  printf("\n");
  return 0;
}
