#include <bits/stdc++.h>
using namespace std;
vector<int> Count[10010];
vector<int> ans[2];
int sum[2] = {0, 0};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    Count[x].push_back(i);
  }
  for (int i = 0; i <= 10000; ++i) {
    for (int j = 0; j < Count[i].size(); ++j) {
      int x = Count[i][j];
      if (ans[0].size() != ans[1].size()) {
        if (ans[0].size() < ans[1].size()) {
          ans[0].push_back(x);
          sum[0] += i;
        } else {
          ans[1].push_back(x);
          sum[1] += i;
        }
      } else {
        if (sum[0] < sum[1]) {
          ans[0].push_back(x);
          sum[0] += i;
        } else {
          ans[1].push_back(x);
          sum[1] += i;
        }
      }
    }
  }
  for (int i = 0; i < 2; ++i) {
    cout << ans[i].size() << endl;
    for (int j = 0; j < ans[i].size(); ++j) {
      cout << ans[i][j] + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
