#include <bits/stdc++.h>
using namespace std;
long long toi(string s) {
  istringstream is(s);
  long long t;
  is >> t;
  return t;
}
string tos(long long t) {
  stringstream st;
  st << t;
  return st.str();
}
int main() {
  int n;
  while (cin >> n) {
    vector<pair<int, int> > v(n);
    for (int i = 0; i < v.size(); i++) {
      int x;
      cin >> x;
      v[i] = make_pair(x, i + 1);
    }
    sort(v.begin(), v.end());
    vector<int> a;
    vector<int> b;
    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];
      if (i + 1 != a.size()) cout << " ";
    }
    cout << endl;
    cout << b.size() << endl;
    for (int i = 0; i < b.size(); i++) {
      cout << b[i];
      if (i + 1 != b.size()) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
