#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    a[i] = {temp, i + 1};
  }
  sort(a.begin(), a.end());
  vector<int> left, right;
  int i = 0, j = n - 2, ball = 1, ls = 0, rs = 0;
  while (i < j) {
    if (ball) {
      right.push_back(a[i].second);
      right.push_back(a[j].second);
      rs += a[i].first + a[j].first;
    } else {
      left.push_back(a[i].second);
      left.push_back(a[j].second);
      ls += a[i].first + a[j].first;
    }
    i++;
    j--;
    ball ^= 1;
  }
  if (i == j) {
    if (ls < rs) {
      ls += a[i].first;
      left.push_back(a[i].second);
    } else {
      rs += a[i].first;
      right.push_back(a[i].second);
    }
  }
  if (ls < rs) {
    ls += a[n - 1].first;
    left.push_back(a[n - 1].second);
  } else {
    rs += a[n - 1].first;
    right.push_back(a[n - 1].second);
  }
  cout << left.size() << endl;
  for (int i = 0; i < left.size(); i++) cout << left[i] << " ";
  cout << endl;
  cout << right.size() << endl;
  for (int i = 0; i < right.size(); i++) cout << right[i] << " ";
}
