#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> x, pair<int, int> y) { return x.second < y.second; }
int main() {
  int n;
  cin >> n;
  pair<int, int> p[100005];
  for (int i = 0; i < n; i++) {
    p[i].first = i + 1;
    cin >> p[i].second;
  }
  sort(p, p + n, comp);
  if (n % 2)
    cout << n / 2 + 1 << endl;
  else
    cout << n / 2 << endl;
  for (int i = 0; i < n; i += 2) cout << p[i].first << " ";
  cout << endl;
  cout << n / 2 << endl;
  for (int i = 1; i < n; i += 2) cout << p[i].first << " ";
  return 0;
}
