#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  vector<int> m[10002];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]].push_back(i + 1);
  }
  sort(a, a + n);
  cout << (n + 1) / 2 << endl;
  for (int i = 0; i < n; i += 2) {
    int s = m[a[i]].size();
    cout << m[a[i]][s - 1] << " ";
    m[a[i]].pop_back();
  }
  cout << "\n" << n - (n + 1) / 2 << endl;
  for (int i = 1; i < n; i += 2) {
    int s = m[a[i]].size();
    cout << m[a[i]][s - 1] << " ";
    m[a[i]].pop_back();
  }
  return 0;
}
