#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(make_pair(a, i + 1));
  }
  sort(v.begin(), v.end());
  int s1 = 0, s2 = 0;
  vector<int> v1, v2;
  for (int i = 0; i < n; i++) {
    if (s1 >= s2) {
      if (i + 1 != n) {
        s1 += v[i].first;
        v1.push_back(v[i].second);
        i++;
        s2 += v[i].first;
        v2.push_back(v[i].second);
      } else {
        s2 += v[i].first;
        v2.push_back(v[i].second);
      }
    } else {
      if (i + 1 != n) {
        s2 += v[i].first;
        v2.push_back(v[i].second);
        i++;
        s1 += v[i].first;
        v1.push_back(v[i].second);
      } else {
        s1 += v[i].first;
        v1.push_back(v[i].second);
      }
    }
  }
  cout << v1.size() << "\n";
  for (int i = 0; i != v1.size(); i++) cout << v1[i] << " ";
  cout << "\n" << v2.size() << "\n";
  for (int i = 0; i != v2.size(); i++) cout << v2[i] << " ";
}
