#include <bits/stdc++.h>
using namespace std;
int a[100000], s[100000];
void qs(int q, int w) {
  int e = q, r = w, t = a[q + (rand() % (w - q + 1))], y;
  do {
    while (a[e] < t) e++;
    while (a[r] > t) r--;
    if (e <= r) {
      y = a[e];
      a[e] = a[r];
      a[r] = y;
      y = s[e];
      s[e] = s[r];
      s[r] = y;
      e++;
      r--;
    }
  } while (e <= r);
  if (q < r) qs(q, r);
  if (e < w) qs(e, w);
}
int main() {
  int q, w, e, r, t;
  cin >> q;
  for (w = 0; w < q; w++) {
    cin >> a[w];
    s[w] = w + 1;
  }
  qs(0, q - 1);
  cout << (q + 1) / 2 << "\n";
  for (w = 0; w < q; w += 2) cout << s[w] << " ";
  cout << "\n" << q / 2 << "\n";
  for (w = 1; w < q; w += 2) cout << s[w] << " ";
  return 0;
}
