#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
vector<int> a, b;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    v.push_back({x, i});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (i % 2 == 0) {
      a.push_back(v[i].second);
    } else {
      b.push_back(v[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] << " ";
  }
  cout << endl;
  return 0;
}
