#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
int main() {
  int n;
  cin >> n;
  pair<int, int> a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a, a + n, comp);
  long long int sum1 = 0, sum2 = 0;
  vector<int> t1, t2;
  int ct = 1, ct1 = 1;
  int g;
  if (n % 2 == 0)
    g = n / 2;
  else
    g = n / 2 + 1;
  for (int j = n - 1; j >= 0; j--) {
    if (abs(sum1 - sum2 + a[j].first) <= a[n - 1].first && ct <= g) {
      if (ct == g && n % 2 == 1) g--;
      sum1 += a[j].first;
      t1.push_back(a[j].second);
      ct++;
    } else if (ct1 <= g) {
      if (ct1 == g && n % 2 == 1) g--;
      sum2 += a[j].first;
      t2.push_back(a[j].second);
      ct1++;
    }
  }
  cout << t1.size() << endl;
  for (auto i : t1) cout << i << " ";
  cout << endl << t2.size() << endl;
  for (auto i : t2) cout << i << " ";
  return 0;
}
