#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
vector<pair<int, int> > a;
int main() {
  int n;
  cin >> n;
  a.resize(n);
  for (int i = (0); i < (int)(n); ++i) cin >> a[i].first, a[i].second = i + 1;
  sort(((a).begin()), ((a).end()));
  cout << n / 2 + n % 2 << "\n";
  for (int i = 0; i < n; i += 2) cout << a[i].second << " ";
  cout << "\n" << n / 2 << "\n";
  for (int i = 1; i < n; i += 2) cout << a[i].second << " ";
  return 0;
}
