#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
const int maxn = 1e5 + 10;
const int maxa = 1e4 + 10;
struct Point {
  int v, id;
  bool operator<(const Point& rhs) const { return rhs.v < this->v; }
} a[maxn];
int n, sum1, sum2;
vector<int> v1, v2;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i].v);
    a[i].id = i;
  }
  sort(a, a + n);
  for (int i = 0; i + 1 < n; i += 2) {
    if (sum1 < sum2) {
      sum1 += a[i + 1].v;
      v1.push_back(a[i + 1].id);
      sum2 += a[i].v;
      v2.push_back(a[i].id);
    } else {
      sum1 += a[i].v;
      v1.push_back(a[i].id);
      sum2 += a[i + 1].v;
      v2.push_back(a[i + 1].id);
    }
  }
  if (n & 1) {
    if (sum1 < sum2) {
      sum1 += a[n - 1].v;
      v1.push_back(a[n - 1].id);
    } else {
      sum2 += a[n - 1].v;
      v2.push_back(a[n - 1].id);
    }
  }
  printf("%d\n", (int)v1.size());
  for (int c : v1) printf("%d ", c + 1);
  printf("\n");
  printf("%d\n", (int)v2.size());
  for (int c : v2) printf("%d ", c + 1);
  printf("\n");
}
