#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
vector<pair<int, int> > t[2];
int s[2];
int main() {
  int n;
  scanf("%d", &n);
  v.resize(n);
  int mx = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i].first);
    mx = max(mx, v[i].first);
    v[i].second = i + 1;
  }
  s[0] = s[1] = 0;
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    t[i % 2].push_back(v[i]);
    s[i % 2] += v[i].first;
  }
  int ix = t[1].size() - 1;
  while (s[1] - s[0] > mx) {
    s[0] += -t[0][ix].first + t[1][ix].first;
    s[1] += -t[1][ix].first + t[0][ix].first;
    swap(t[1][ix], t[0][ix]);
    ix--;
  }
  printf("%d\n", t[0].size());
  for (int i = 0; i < t[0].size(); i++) printf("%d ", t[0][i].second);
  printf("\n");
  printf("%d\n", t[1].size());
  for (int i = 0; i < t[1].size(); i++) printf("%d ", t[1][i].second);
}
