#include <bits/stdc++.h>
using namespace std;
int n, tmp;
vector<pair<int, int> > v;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    v.push_back(make_pair(tmp, i + 1));
  }
  sort(v.begin(), v.end());
  cout << n / 2 << '\n';
  for (int i = 1; i < n; i = i + 2) cout << v[i].second << " ";
  cout << '\n';
  cout << ceil((double)n / 2) << '\n';
  for (int i = 0; i < n; i = i + 2) cout << v[i].second << " ";
  return 0;
}
