#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> a[100009];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i].first), a[i].second = i + 1;
  sort(a, a + n);
  printf("%d\n", n / 2 + (n & 1));
  int sum = 0;
  for (int i = 0; i < n; i += 2) printf("%d ", a[i].second);
  puts("");
  printf("%d\n", n / 2);
  for (int i = 1; i < n; i += 2) printf("%d ", a[i].second);
  return 0;
}
