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