#include <bits/stdc++.h>
using namespace std;
const int inf(1010101010);
int n;
pair<int, int> a[100005];
int mxsz;
struct team {
  int som;
  vector<int> elem;
  team() : som(0) {}
  bool vol() { return ((int)(elem).size()) == mxsz; }
  void addt(pair<int, int>& x) { som += x.first, elem.push_back(x.second); }
  void out() {
    cout << ((int)(elem).size()) << endl;
    for (__typeof((elem).end()) it((elem).begin()); it != (elem).end(); ++it) {
      if (it != (elem).begin()) putchar(' ');
      cout << *it;
    }
    cout << endl;
  }
};
team t1, t2;
int main() {
  cin >> n;
  for (int i(0); i < (n); i++) cin >> a[i].first, a[i].second = i + 1;
  mxsz = (n + 1) / 2;
  sort(a, a + n, greater<pair<int, int> >());
  for (int i(0); i < (n); i++) {
    if (t1.vol())
      t2.addt(a[i]);
    else if (t2.vol())
      t1.addt(a[i]);
    else if (t1.som < t2.som)
      t1.addt(a[i]);
    else
      t2.addt(a[i]);
  }
  t1.out(), t2.out();
}
