#include <bits/stdc++.h>
using namespace std;
int n, sum, as, b[100005], len, ia, la;
pair<int, int> a[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i + 1;
    sum += a[i].first;
  }
  sort(a, a + n);
  la = n / 2;
  for (int i = 0; i < n / 2; ++i) as += a[i].first;
  for (int d = (sum - a[n - 1].first + 1) / 2; as < d;
       as -= a[ia++].first, as += a[la++].first)
    ;
  cout << la - ia << endl;
  for (int i = 0; i < n; ++i) {
    if (i < ia || i >= la)
      b[len++] = a[i].second;
    else {
      if (i - ia) cout << " ";
      cout << a[i].second;
    }
  }
  cout << endl;
  cout << len << endl;
  for (int i = 0; i < len; ++i) {
    if (i) cout << " ";
    cout << b[i];
  }
  cout << endl;
  return 0;
}
