#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, an, n1, n2;
pair<int, int> a[100001];
int f[100000];
long long x, y;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i].first);
    a[i].second = i + 1;
  }
  sort(a, a + n);
  for (i = n - 1; i > 0; i = i - 2) {
    if (x > y) {
      y += a[i].first;
      x += a[i - 1].first;
      f[i] = 2;
      f[i - 1] = 1;
    } else {
      y += a[i - 1].first;
      x += a[i].first;
      f[i] = 1;
      f[i - 1] = 2;
    }
  }
  n1 = n / 2;
  n2 = n / 2;
  if (n % 2 == 1)
    if (x > y) {
      n2++;
      f[0] = 2;
    } else {
      n1++;
      f[0] = 1;
    }
  printf("%d\n", n1);
  for (i = 0; n1 > 0; i++)
    if (f[i] == 1) {
      n1--;
      if (n1 == 0)
        printf("%d\n", a[i].second);
      else
        printf("%d ", a[i].second);
    }
  printf("%d\n", n2);
  for (i = 0; n2 > 0; i++)
    if (f[i] == 2) {
      n2--;
      if (n2 == 0)
        printf("%d\n", a[i].second);
      else
        printf("%d ", a[i].second);
    }
}
