#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = int(1e9);
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i + 1;
  }
  sort(p.begin(), p.end());
  vector<int> aa, bb;
  int a, b;
  a = n / 2;
  b = n - a;
  for (int i = 1; i < n; i += 2) {
    aa.push_back(p[i].second);
  }
  for (int i = 0; i < n; i += 2) {
    bb.push_back(p[i].second);
  }
  cout << a << "\n";
  for (auto cur : aa) {
    cout << cur << " ";
  }
  cout << "\n" << b << "\n";
  for (auto cur : bb) {
    cout << cur << " ";
  }
  return 0;
}
