#include <bits/stdc++.h>
using namespace std;
pair<int, int> v[100005];
int n, i, m, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 0; i < n; i++) cin >> v[i].first, v[i].second = i + 1;
  sort(v, v + n);
  m = n / 2, k = n / 2;
  if (n % 2 == 1) m++;
  cout << m << endl;
  for (i = 0; i < n; i += 2) cout << v[i].second << " ";
  cout << endl << k << endl;
  for (i = 1; i < n; i += 2) cout << v[i].second << " ";
  cout << endl;
  return 0;
}
