#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100003];
vector<int> a1, a2;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i + 1;
  }
  sort(p, p + n);
  for (int i = 0; i < n; i++) {
    if (i % 2)
      a1.push_back(p[i].second);
    else
      a2.push_back(p[i].second);
  }
  cout << a1.size() << endl;
  for (int i = 0; i < a1.size(); i++) cout << a1[i] << " ";
  cout << endl << a2.size() << endl;
  for (int i = 0; i < a2.size(); i++) cout << a2[i] << " ";
}
