#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > arr;
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    arr.push_back({a, i});
  }
  sort(arr.begin(), arr.end());
  reverse(arr.begin(), arr.end());
  vector<pair<int, int> > fir, sec;
  long sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      sum1 += arr[i].first;
      fir.push_back({arr[i].first, arr[i].second});
    } else {
      sum2 += arr[i].first;
      sec.push_back({arr[i].first, arr[i].second});
    }
  }
  int i = 0, j = 0;
  while (abs(sum1 - sum2) > arr[0].first && i < min(fir.size(), sec.size())) {
    pair<int, int> f = fir[i];
    pair<int, int> s = sec[i];
    sum1 -= f.first;
    sum1 += s.first;
    sum2 -= s.first;
    sum2 += f.first;
    fir[i] = s;
    sec[i] = f;
  }
  cout << fir.size() << endl;
  for (i = 0; i < fir.size(); i++) {
    cout << fir[i].second + 1 << " ";
  }
  cout << endl;
  cout << sec.size() << endl;
  for (i = 0; i < sec.size(); i++) {
    cout << sec[i].second + 1 << " ";
  }
  cout << endl;
  return 0;
}
