#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, x;
  cin >> n;
  vector<std::pair<int, int> > v;
  for (int i = 0; i < (n); ++i) {
    cin >> x;
    v.push_back({x, i + 1});
  }
  sort(v.begin(), v.end());
  vector<int> v1, v2;
  for (int i = 0; i < ((int)v.size()); ++i) {
    if (i % 2)
      v1.push_back(v[i].second);
    else
      v2.push_back(v[i].second);
  }
  cout << (int)v1.size() << "\n";
  for (int i = 0; i < ((int)v1.size()); ++i) cout << v1[i] << " ";
  cout << "\n";
  cout << (int)v2.size() << "\n";
  for (int i = 0; i < ((int)v2.size()); ++i) cout << v2[i] << " ";
  cout << "\n";
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
