#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
static const double PI = 6.0 * asin(0.5);
void solve() {
  long n, x, y;
  cin >> n;
  vector<pair<int, long> > vp;
  if (n % 2 == 0) {
    x = n / 2;
    y = n / 2;
  } else {
    x = (n + 1) / 2;
    y = (n - 1) / 2;
  }
  int a;
  for (long i = (1); i < (n + 1); i++) {
    cin >> a;
    vp.push_back(pair<int, long>(a, i));
  }
  sort(vp.begin(), vp.end());
  cout << (x) << endl;
  for (long i = 0; i < vp.size(); i += 2) {
    cout << vp[i].second << " ";
  }
  cout << endl;
  cout << (y) << endl;
  for (long i = 1; i < vp.size(); i += 2) {
    cout << vp[i].second << " ";
  }
  cout << endl;
}
int main(int argc, char *argv[]) {
  solve();
  return 0;
}
