#include <bits/stdc++.h>
using namespace std;
struct people {
  int num;
  int date;
} P[1000010];
bool cmp(people a, people b) { return a.date < b.date; }
int main() {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &P[i].date);
    P[i].num = i + 1;
  }
  sort(P, P + n, cmp);
  printf("%d\n%d", n / 2, P[1].num);
  for (i = 3; i < n; i += 2) printf(" %d", P[i].num);
  printf("\n%d\n%d", n - n / 2, P[0].num);
  for (i = 2; i < n; i += 2) printf(" %d", P[i].num);
  putchar(10);
  return (0);
}
