#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, int> ar[n];
  int tot = 0;
  for (int i = 0; i < n; i++) {
    cin >> ar[i].first;
    tot += ar[i].first;
    ar[i].second = i + 1;
  }
  sort(ar, ar + n);
  int dif = ar[n - 1].first;
  for (int i = 1; i < n; i++) {
    ar[i].first += ar[i - 1].first;
  }
  int x = ceil(n / 2);
  for (int i = 0; i + x <= n; i++) {
    int sum = ar[i + x - 1].first;
    if (i) sum -= ar[i - 1].first;
    int left = tot - sum;
    if (abs(left - sum) <= dif) {
      cout << x << "\n";
      int use[n + 1];
      memset(use, 0, sizeof(use));
      for (int j = i; j < i + x; j++) {
        cout << ar[j].second << " ";
        use[ar[j].second] = 1;
      }
      cout << "\n" << n - x << "\n";
      for (int i = 1; i <= n; i++) {
        if (!use[i]) cout << i << " ";
      }
      return 0;
    }
  }
}
