#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > igraci;
int main() {
  vector<int> a;
  vector<int> b;
  int n, pb;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pb;
    igraci.push_back(make_pair(pb, i + 1));
  }
  sort(igraci.begin(), igraci.end());
  for (int i = 0; i < n; i++) {
    if (i & 1)
      a.push_back(igraci[i].second);
    else
      b.push_back(igraci[i].second);
  }
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
  cout << b.size() << endl;
  for (int i = 0; i < b.size(); i++) cout << b[i] << " ";
  return 0;
}
