#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
vector<int> v1, v2;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    v.push_back(pair<int, int>(temp, i + 1));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (i % 2)
      v1.push_back(v[i].second);
    else
      v2.push_back(v[i].second);
  }
  cout << v1.size() << endl;
  for (int i = 0; i < v1.size(); i++) cout << v1[i] << ' ';
  cout << endl;
  cout << v2.size() << endl;
  for (int i = 0; i < v2.size(); i++) cout << v2[i] << ' ';
  cout << endl;
  return 0;
}
