#include <bits/stdc++.h>
using namespace std;
int n, c[100007], sum = 0;
pair<int, int> a[100007];
void doit(int k) {
  for (int i = 1; i + k - 1 <= n; i++) {
    long long ans = c[i + k - 1] - c[i - 1];
    if (abs(sum - 2 * ans) <= a[n].first) {
      cout << k << endl;
      for (int j = i; j < i + k; j++) cout << a[j].second << " ";
      cout << endl << n - k << endl;
      for (int j = 1; j <= n; j++) {
        if (j < i || j > i + k - 1) cout << a[j].second << " ";
      }
      cout << endl;
      exit(0);
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    sum += a[i].first;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) c[i] += c[i - 1] + a[i].first;
  doit(n / 2), doit(n - (n / 2));
}
