#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > ans(n);
  for (int i = 0; i < n; i++) {
    cin >> ans[i].first;
    ans[i].second = i;
  }
  sort(ans.begin(), ans.end());
  int sum1 = 0, sum2 = 0;
  vector<int> res1, res2;
  for (int i = 0; i < n; i++) {
    if (sum1 <= sum2) {
      sum1 += ans[i].first;
      res1.push_back(ans[i].second + 1);
    } else {
      sum2 += ans[i].first;
      res2.push_back(ans[i].second + 1);
    }
  }
  cout << res1.size() << endl;
  for (int i = 0; i < res1.size(); i++) {
    cout << res1[i] << " ";
  }
  cout << endl;
  cout << res2.size() << endl;
  for (int i = 0; i < res2.size(); i++) {
    cout << res2[i] << " ";
  }
}
