#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, j, k, n;
  cin >> n;
  vector<pair<int, int> > v(n);
  for (i = 0; i < n; ++i) {
    cin >> k;
    v[i] = {k, i + 1};
  }
  sort(v.begin(), v.end());
  cout << n / 2 + (n % 2) << endl;
  for (i = 0; i < n; i += 2) cout << v[i].second << " ";
  cout << endl;
  cout << n / 2 << endl;
  for (i = 1; i < n; i += 2) cout << v[i].second << " ";
  cout << endl;
}
