#include <bits/stdc++.h>
using namespace std;
int N, M, T;
pair<int, int> p[100005];
int main() {
  int i, j, k;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    scanf("%d", &p[i].first);
    p[i].second = i;
  }
  sort(&p[1], &p[N + 1]);
  printf("%d\n", N / 2);
  for (i = 2; i <= N; i += 2) printf("%d ", p[i].second);
  printf("\n%d\n", N - N / 2);
  for (i = 1; i <= N; i += 2) printf("%d ", p[i].second);
  scanf(" ");
}
