#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
void qsort(int l, int r) {
  int x, y, m, t;
  x = l;
  y = r;
  m = a[(l + r) / 2];
  do {
    while (a[l] > m) l++;
    while (a[r] < m) r--;
    if (l <= r) {
      t = a[l];
      a[l] = a[r];
      a[r] = t;
      t = b[l];
      b[l] = b[r];
      b[r] = t;
      l++;
      r--;
    }
  } while (l <= r);
  if (l < y) qsort(l, y);
  if (x < r) qsort(x, r);
}
int main() {
  int i, n, s, bo[50005], gi[50005];
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = i;
  }
  qsort(1, n);
  bo[1] = b[1];
  gi[1] = b[2];
  s = a[1] - a[2];
  for (i = 3; i <= n; i += 2) {
    if (abs(s + a[i] - a[i + 1]) >= abs(s + a[i + 1] - a[i])) {
      bo[(i + 1) / 2] = b[i];
      gi[(i + 1) / 2] = b[i + 1];
      s = abs(s + a[i] - a[i + 1]);
    } else {
      bo[(i + 1) / 2] = b[i + 1];
      gi[(i + 1) / 2] = b[i];
      s = abs(s + a[i + 1] - a[i]);
    }
  }
  cout << (n + 1) / 2 << endl;
  for (i = 1; i < (n + 1) / 2; i++) cout << bo[i] << " ";
  cout << bo[i] << endl;
  cout << n / 2 << endl;
  for (i = 1; i < n / 2; i++) cout << gi[i] << " ";
  cout << gi[i] << endl;
  return (0);
}
