#include <bits/stdc++.h>
using namespace std;
void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n, mx, sum1, sum2;
vector<int> g1, g2;
pair<int, int> a[200000];
int main() {
  boost();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + 1 + n);
  for (int i = n; i > 0; i--) {
    if (i & 1) {
      g1.push_back(a[i].second);
    } else {
      g2.push_back(a[i].second);
    }
  }
  cout << g1.size() << endl;
  for (int i = 0; i < g1.size(); i++) {
    cout << g1[i] << " ";
  }
  cout << endl;
  cout << g2.size() << endl;
  for (int i = 0; i < g2.size(); i++) {
    cout << g2[i] << " ";
  }
}
