#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[100001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  cout << (n + 1) / (1 + 1) << endl;
  for (int i = 1; i <= n; i += 2) cout << a[i].second << ' ';
  cout << endl;
  cout << n / (1 + 1) << endl;
  for (int i = 2; i <= n; i += 2) cout << a[i].second << ' ';
  return 0;
}
