#include <bits/stdc++.h>
using namespace std;
long long getInt() {
  long long ret;
  char tmpc;
  bool sign = 0;
  while (tmpc = getchar(), !isdigit(tmpc)) sign = (tmpc == '-');
  ret = tmpc - '0';
  while (tmpc = getchar(), isdigit(tmpc)) ret = ret * 10 + tmpc - '0';
  if (sign) ret *= -1;
  return ret;
}
const double PI = 2.0 * acos(0.0);
const double EX = 2.7182818284;
const int MOD = 1e9 + 7;
const int oo = 2e9 + 1e8;
int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
int dj[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dik[] = {-1, -1, 1, 1, -2, -2, 2, 2};
int djk[] = {2, -2, 2, -2, 1, -1, 1, -1};
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
int main() {
  int n, l, r;
  n = getInt();
  vector<pair<int, int> > in(n);
  vector<int> a, b;
  for (long long i = 0; i < (long long)n; i++) {
    in[i].first = getInt();
    in[i].second = i + 1;
  }
  sort(in.begin(), in.end());
  for (long long i = 0; i < (long long)n; i++)
    if (i & 1)
      a.push_back(in[i].second);
    else
      b.push_back(in[i].second);
  printf("%d\n", (int)a.size());
  for (long long i = 0; i < (long long)(int)a.size(); i++) printf("%d ", a[i]);
  printf("\n%d\n", (int)b.size());
  for (long long i = 0; i < (long long)(int)b.size(); i++) printf("%d ", b[i]);
  printf("\n");
  return 0;
}
