#include <bits/stdc++.h>
using namespace std;
struct T {
  int v, d;
} p[100005];
bool cmp(T x, T y) { return x.v < y.v; }
int main() {
  int i, n, sum1, sum2, x, y;
  vector<int> g1, g2;
  g1.clear();
  g2.clear();
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &p[i].v);
    p[i].d = i;
  }
  sort(p, p + n, cmp);
  g1.push_back(p[1].d);
  g2.push_back(p[2].d);
  sum1 = p[1].v;
  sum2 = p[2].v;
  x = y = 1;
  for (i = 3; i <= n; i++) {
    if (sum1 < sum2) {
      sum1 += p[i].v;
      g1.push_back(p[i].d);
      x++;
    } else {
      sum2 += p[i].v;
      g2.push_back(p[i].d);
      y++;
    }
  }
  printf("%d\n", x);
  for (i = 0; i < g1.size(); i++) printf("%d ", g1[i]);
  printf("\n");
  printf("%d\n", y);
  for (i = 0; i < g2.size(); i++) printf("%d ", g2[i]);
  printf("\n");
  return 0;
}
