#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, temp;
  while (cin >> n) {
    vector<pair<int, int> > boys;
    for (i = 1; i <= n; i++) {
      cin >> temp;
      boys.push_back(make_pair(temp, i));
    }
    sort(boys.begin(), boys.end());
    vector<pair<int, int> > x, y;
    long long sumx = 0, sumy = 0, maxv;
    maxv = boys[n - 1].first;
    for (i = (n - 1); i >= 0; i--) {
      if (i % 2 == 0) {
        x.push_back(boys[i]);
        sumx += boys[i].first;
      } else {
        y.push_back(boys[i]);
        sumy += boys[i].first;
      }
    }
    while (abs(sumx - sumy) > maxv && (x.size() - y.size()) <= 1) {
      int value, num;
      value = x[0].first;
      num = x[0].second;
      x.erase(x.begin());
      sumx -= value;
      sumy += value;
      y.push_back(make_pair(value, num));
    }
    cout << x.size() << endl;
    for (i = 0; i < (int)x.size(); i++) cout << x[i].second << " ";
    cout << endl;
    cout << y.size() << endl;
    for (i = 0; i < (int)y.size(); i++) cout << y[i].second << " ";
    cout << endl;
  }
  return 0;
}
