#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int MaxN = 100005, NA = -1, MaxC = 0x3F3F3F3F;
int a[MaxN];
int n;
int main(void) {
  int i;
  while (scanf(" %d", &n) != EOF) {
    vector<pair<int, int> > v;
    for (i = 0; i < n; i++) {
      scanf(" %d", &a[i]);
      v.push_back(make_pair(a[i], i));
    }
    sort(v.begin(), v.end(), greater<pair<int, int> >());
    vector<pair<int, int> > x, y;
    int sx, sy;
    sx = sy = 0;
    for (i = 0; i + 2 <= n; i += 2) {
      if (sx < sy) {
        x.push_back(v[i]);
        sx += v[i].first;
        y.push_back(v[i + 1]);
        sy += v[i + 1].first;
      } else {
        y.push_back(v[i]);
        sy += v[i].first;
        x.push_back(v[i + 1]);
        sx += v[i + 1].first;
      }
    }
    if (i != n) {
      if (sx < sy) {
        x.push_back(v[n - 1]);
      } else {
        y.push_back(v[n - 1]);
      }
    }
    printf("%d\n", (int)x.size());
    for (i = 0; i < (int)x.size(); i++)
      printf("%d%c", x[i].second + 1, i + 1 < (int)x.size() ? ' ' : '\n');
    printf("%d\n", (int)y.size());
    for (i = 0; i < (int)y.size(); i++)
      printf("%d%c", y[i].second + 1, i + 1 < (int)y.size() ? ' ' : '\n');
  }
  return 0;
}
