#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
using pcc = pair<char, char>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
using vpii = vector<pii>;
using vc = vector<char>;
using vd = vector<double>;
template <typename T>
T POW(T a, T b) {
  T x = 1;
  while (b) {
    if (b & 1) x *= a;
    a *= a;
    b >>= 1;
  }
  return x;
}
template <typename T>
T mPOW(T a, T b, T M) {
  T x = 1;
  while (b) {
    if (b & 1) x = (x * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return x;
}
template <typename T>
T Sqrt(T a) {
  T x = (T)sqrt(a);
  if ((x + 1) * (x + 1) == a) x++;
  return x;
}
int main(int argc, char *argv[]) {
  int n, a = 0, b = 0;
  scanf("%d%*c", &(n));
  vector<pii> ara;
  vector<int> aa, bb;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d%*c", &(x));
    ara.push_back({x, i});
  }
  sort(ara.begin(), ara.end());
  for (int i = 0; i < n; i++) {
    int x = ara[i].first;
    if (a <= b) {
      aa.push_back(ara[i].second);
      a += x;
    } else {
      b += x;
      bb.push_back(ara[i].second);
    }
  }
  printf("%d", (aa.size()));
  printf("\n");
  for (auto &x : aa) printf("%d", (x)), printf(" ");
  printf("\n");
  printf("%d", (bb.size()));
  printf("\n");
  for (auto &x : bb) printf("%d", (x)), printf(" ");
  printf("\n");
  return 0;
}
