#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > mans;
  for (int i = (0); i < ((n)); ++i) {
    int a;
    cin >> a;
    mans.push_back(make_pair(a, i + 1));
  }
  sort(mans.begin(), mans.end());
  reverse(mans.begin(), mans.end());
  int const strongest = mans[0].first;
  int sum1 = 0, sum2 = 0;
  vector<int> l, r;
  for (int i = (0); i < ((n)); ++i) {
    l.push_back(mans[i].second);
    sum1 += mans[i].first;
    ++i;
    while (i < n) {
      sum2 += mans[i].first;
      r.push_back(mans[i].second);
      ++i;
      if (abs(sum1 - sum2) <= strongest) break;
    }
    --i;
  }
  cout << (int)l.size() << endl;
  for (int i = (0); i < (((int)l.size())); ++i) {
    if (i) cout << " ";
    cout << l[i];
  }
  cout << endl << (int)r.size() << endl;
  for (int i = (0); i < (((int)r.size())); ++i) {
    if (i) cout << " ";
    cout << r[i];
  }
  cout << endl;
  return 0;
}
