#include <bits/stdc++.h>
using namespace std;
long long arr[500007], brr[500007], crr[500007];
long long ar[1000][1000], br[1000][1000], cr[1000][1000];
char att[1000], m1, m2;
long long d1, d2, d3, d4, d5, d6, d7;
string g, h, v;
vector<long long> v2;
int main() {
  long long a, b, c, d, e, f, i, j, k, l, m, n, r, t, w, x, y, z, ans, sum;
  vector<pair<long long, long long>> v1;
  d = 0, e = 0, f = 0, l = 0, n = 0, ans = 0, sum = 0;
  cin >> a;
  for (i = 1; i <= a; i++) cin >> b, v1.push_back({b, i});
  sort(v1.begin(), v1.end());
  k = a / 2;
  if (a % 2 == 1) k++;
  cout << k << endl;
  for (i = 0; i < v1.size(); i++) {
    if (i % 2 == 0) cout << v1[i].second << " ";
  }
  cout << "\n";
  cout << a - k << endl;
  for (i = 1; i < v1.size(); i++) {
    if (i % 2 == 1) cout << v1[i].second << " ";
  }
  cout << "\n";
  return 0;
}
