#include <bits/stdc++.h>
using namespace std;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, -1, 1};
const double eps = 1e-9;
const int INF = 0x7FFFFFFF;
const long long INFLL = 0x7FFFFFFFFFFFFFFFLL;
const double pi = acos(-1);
double dot(complex<double> a, complex<double> b) { return real(conj(a) * b); }
double cross(complex<double> a, complex<double> b) { return imag(conj(a) * b); }
double triarea(complex<double> a, complex<double> b, complex<double> c) {
  return 0.5 * abs(cross(b - a, c - a));
}
double dist_point_point(complex<double> a, complex<double> b) {
  return abs(sqrt(b - a));
}
double dist_point_line(complex<double> p, complex<double> a,
                       complex<double> b) {
  return abs(cross(p - a, b - a)) / abs(b - a);
}
vector<pair<int, int> > vc;
vector<int> a, b;
int n, z;
int main() {
  scanf("%d", &n);
  for (int(i) = (0), _t = (n); i < (_t); ++(i)) {
    scanf("%d", &z);
    vc.push_back(make_pair(z, i + 1));
  }
  if ((int)vc.size() & 1) vc.push_back(make_pair(0, -1));
  sort(vc.begin(), vc.end());
  z = (int)vc.size();
  for (int i = 0; i < z; ++i) {
    if (vc[i].second != -1) a.push_back(vc[i].second);
    ++i;
    if (vc[i].second != -1) b.push_back(vc[i].second);
  }
  printf("%d\n", (int)a.size());
  for (int(i) = (0), _t = ((int)a.size()); i < (_t); ++(i))
    printf((i) ? " %d" : "%d", a[i]);
  puts("");
  printf("%d\n", (int)b.size());
  for (int(i) = (0), _t = ((int)b.size()); i < (_t); ++(i))
    printf((i) ? " %d" : "%d", b[i]);
  puts("");
  return 0;
}
