#include <bits/stdc++.h>
struct dat {
  int data, i;
} data[100000 + 10];
int n, team[2][100000 + 10], len[2];
bool sortf(dat a, dat b) {
  if (a.data < b.data) return true;
  return false;
}
int main() {
  int i, temp, tog = 1, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &data[i].data);
    data[i].i = i + 1;
  }
  std::sort(data, data + n, sortf);
  len[0] = len[1] = 0;
  for (i = n - 1; i >= 0; i--) {
    tog = 1 - tog;
    team[tog][len[tog]++] = data[i].i;
  }
  for (i = 0; i < 2; i++) {
    printf("%d\n", len[i]);
    for (j = 0; j < len[i]; j++) {
      printf("%d ", team[i][j]);
    }
    printf("\n");
  }
  return 0;
}
