#include <bits/stdc++.h>
using namespace std;
void qSort(int *A, int low, int high, int *ii) {
  int i = low;
  int j = high;
  int x = A[(low + high) / 2];
  do {
    while (A[i] < x) ++i;
    while (A[j] > x) --j;
    if (i <= j) {
      int temp = A[i];
      int buf = ii[i];
      ii[i] = ii[j];
      ii[j] = buf;
      A[i] = A[j];
      A[j] = temp;
      i++;
      j--;
    }
  } while (i <= j);
  if (low < j) qSort(A, low, j, ii);
  if (i < high) qSort(A, i, high, ii);
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
  int n;
  cin >> n;
  int *mas = new int[n];
  int *ii = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> mas[i];
    ii[i] = i;
  }
  qSort(mas, 0, n - 1, ii);
  if (n % 2 == 0) {
    cout << n / 2 << endl;
  } else {
    cout << n / 2 + 1 << endl;
  }
  for (int i = 0; i < n; i += 2) {
    cout << ii[i] + 1 << " ";
  }
  cout << endl;
  if (n % 2 == 0) {
    cout << n / 2 << endl;
  } else {
    cout << n / 2 << endl;
  }
  for (int i = 1; i < n; i += 2) {
    cout << ii[i] + 1 << " ";
  }
  cout << endl;
  return 0;
}
