#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> &a, pair<int, int> &b) { return a.first > b.first; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, x;
  cin >> n;
  pair<int, int> a[100005];
  for (int i = 1; i <= n; i++) {
    cin >> x;
    a[i] = {x, i};
  }
  vector<int> team1, team2;
  sort(a + 1, a + n + 1, cmp);
  bool turn = 0;
  for (int i = 1; i <= n; i++) {
    if (turn == 0) {
      team1.push_back(a[i].second);
    } else {
      team2.push_back(a[i].second);
    }
    turn ^= 1;
  }
  cout << team1.size() << endl;
  for (int i = 0; i < team1.size(); i++) cout << team1[i] << " ";
  cout << endl;
  cout << team2.size() << endl;
  for (int i = 0; i < team2.size(); i++) cout << team2[i] << " ";
  cout << endl;
  return 0;
}
