#include <bits/stdc++.h>
using namespace std;
struct int2 {
  int i1, i2;
  int2(int a1, int a2) {
    i1 = a1;
    i2 = a2;
  }
  int2() {
    i1 = 0;
    i2 = 0;
  }
  void set(int a1, int a2) {
    i1 = a1;
    i2 = a2;
  }
  void operator=(int2 ii2) {
    i1 = ii2.i1;
    i2 = ii2.i2;
  }
  bool operator<(int2 ii2) const { return (i1 < ii2.i1); }
};
int main() {
  int n, i;
  cin >> n;
  int b, n1 = 0, n2 = 0, sum1 = 0, sum2 = 0;
  int2 *a = new int2[n], *e1 = new int2[n], *e2 = new int2[n];
  for (i = 0; i < n; i++) {
    cin >> b;
    a[i].set(b, i + 1);
  }
  sort(a, &a[n]);
  for (i = 0; i < (n + 1) / 2; i++) {
    if (sum1 < sum2) {
      e1[n1] = a[i * 2];
      sum1 += a[i * 2].i1;
      n1++;
      if (i * 2 + 1 < n) {
        e2[n2] = a[i * 2 + 1];
        sum2 += a[i * 2 + 1].i1;
        n2++;
      }
    } else {
      e2[n2] = a[i * 2];
      sum2 += a[i * 2].i1;
      n2++;
      if (i * 2 + 1 < n) {
        e1[n1] = a[i * 2 + 1];
        sum1 += a[i * 2 + 1].i1;
        n1++;
      }
    }
  }
  cout << n1 << endl;
  for (i = 0; i < n1; i++) cout << e1[i].i2 << ' ';
  cout << endl << n2 << endl;
  for (i = 0; i < n2; i++) cout << e2[i].i2 << ' ';
  delete[] a;
  delete[] e1;
  delete[] e2;
  return 0;
}
