#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int _ = 1;
  while (_--) {
    long long int n;
    cin >> n;
    pair<long long int, long long int> a[n];
    long long int sum = 0, m = 0, s = 0;
    for (long long int i = 0; i < n; i++) {
      long long int t;
      cin >> t;
      a[i].first = t;
      a[i].second = i + 1;
      (a[i].first > m) ? m = a[i].first : m;
      sum += a[i].first;
    }
    sort(a, a + n);
    if (n % 2 != 0) {
      long long int a1[n / 2 + 1], b[n / 2];
      for (long long int i = 0; i < n; i++) {
        if (i % 2 == 0)
          a1[i / 2] = a[i].second;
        else
          b[i / 2] = a[i].second;
      }
      cout << n / 2 + 1 << endl;
      for (long long int i = 0; i < n / 2 + 1; i++) cout << a1[i] << " ";
      cout << endl << n / 2 << endl;
      for (long long int i = 0; i < n / 2; i++) cout << b[i] << " ";
      cout << "\n";
    } else {
      long long int a1[n / 2], b[n / 2];
      for (long long int i = 0; i < n; i++) {
        if (i % 2 == 0)
          a1[i / 2] = a[i].second;
        else
          b[i / 2] = a[i].second;
      }
      cout << n / 2 << endl;
      for (long long int i = 0; i < n / 2; i++) cout << a1[i] << " ";
      cout << endl << n / 2 << endl;
      for (long long int i = 0; i < n / 2; i++) cout << b[i] << " ";
      cout << "\n";
    }
  }
  return 0;
}
