#include <bits/stdc++.h>
using namespace std;
bool comp(int& a, int& b) { return b < a; }
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> source(n), team1, team2;
  long long sum_team1 = 0, sum_team2 = 0;
  for (int i = 0; i < n; ++i) {
    cin >> source[i].first;
    source[i].second = i;
  }
  sort(source.begin(), source.end());
  int i = 0, par = 1;
  while (!source.empty()) {
    if (par) {
      team1.push_back(source.back());
      source.pop_back();
      par = 0;
      sum_team1 += team1.back().first;
    } else {
      team2.push_back(source.back());
      source.pop_back();
      par = 1;
      sum_team2 += team2.back().first;
    }
  }
  cout << team1.size() << '\n';
  for (int i = 0; i < team1.size(); ++i) cout << team1[i].second + 1 << " ";
  cout << '\n';
  cout << team2.size() << '\n';
  for (int i = 0; i < team2.size(); ++i) cout << team2[i].second + 1 << " ";
  return 0;
}
