#include <bits/stdc++.h>
const int N = 100002;
int pos[N];
int a[N];
bool cmp_lt(int i, int j) { return a[i] < a[j]; }
int main() {
  int i, j, x, y, n;
  scanf("%d", &n);
  for (i = 0; i < (n); i++) scanf("%d", a + i);
  for (i = 0; i < (n); i++) pos[i] = i;
  std::sort(pos, pos + n, cmp_lt);
  x = (n + 1) / 2;
  int delta = 0;
  for (i = 0; i < x; i++) delta -= a[pos[i]];
  for (i = x; i < n; i++) delta += a[pos[i]];
  int maxa = a[pos[n - 1]];
  i = 0;
  j = n - 2;
  while (delta > maxa) {
    delta += 2 * (a[pos[i]] - a[pos[j]]);
    int t = pos[i];
    pos[i] = pos[j];
    pos[j] = t;
    i++;
    j--;
  }
  y = n - x;
  printf("%d\n", x);
  for (i = 0; i < x; i++) printf("%d ", pos[i] + 1);
  printf("\n");
  printf("%d\n", y);
  for (i = x; i < n; i++) printf("%d ", pos[i] + 1);
  printf("\n");
  return 0;
}
