#include <bits/stdc++.h>
using namespace std;
int t1[100009], t2[100009];
pair<int, int> a[100009];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  int s1 = 0, s2 = 0, i1 = 1, i2 = 1;
  for (int i = 1; i <= n; i++) {
    if (s1 < s2) {
      t1[i1] = a[i].second;
      i1++;
      s1 += a[i].first;
    } else {
      t2[i2] = a[i].second;
      i2++;
      s2 += a[i].first;
    }
  }
  cout << i1 - 1 << endl;
  for (int i = 1; i <= i1 - 1; i++) {
    cout << t1[i] << " ";
  }
  cout << endl << i2 - 1 << endl;
  for (int i = 1; i <= i2 - 1; i++) {
    cout << t2[i] << " ";
  }
  return 0;
}
