#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n, 0);
  for (int i = 0, _n = (n); i < _n; i++) cin >> a[i];
  vector<pair<long long, long long> > b(n);
  for (int i = 0, _n = (n); i < _n; i++) b[i] = {a[i], i};
  sort((b).begin(), (b).end());
  sort((a).begin(), (a).end());
  long long l = 0, r = 1;
  vector<long long> pre(n, 0);
  for (int i = 0, _n = (n); i < _n; i++) {
    pre[i] = a[i];
    if (i) pre[i] += pre[i - 1];
  }
  long long sum = pre.back();
  long double maxi = (sum - a.back()) / 2.0;
  long double mini = sum / 2.0;
  vector<long long> ans1, ans2;
  long long cnt = n / 2;
  for (int i = (cnt - 1), _b = (n - 1); i <= _b; i++) {
    long long sumInRange = pre[i];
    if (i - cnt >= 0) sumInRange -= pre[i - cnt];
    if (sumInRange <= mini && sumInRange >= maxi) {
      for (int j = 0, _n = (n); j < _n; j++) {
        if (j <= i - cnt || j > i) {
          ans2.push_back(b[j].second);
        } else {
          ans1.push_back(b[j].second);
        }
      }
      break;
    }
  }
  cout << ans1.size() << '\n';
  for (int i = 0, _n = (ans1.size()); i < _n; i++) {
    cout << ans1[i] + 1 << ' ';
  }
  cout << '\n';
  cout << ans2.size() << '\n';
  for (int i = 0, _n = (ans2.size()); i < _n; i++) {
    cout << ans2[i] + 1 << ' ';
  }
  cout << '\n';
  return;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
