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