#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[100010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i + 1;
  }
  sort(a, a + n);
  long long x[100010], y[100010], j = 0, k = 0;
  for (int i = 0; i < n; i += 2) {
    x[j++] = a[i].second;
    y[k++] = a[i + 1].second;
  }
  cout << j << '\n';
  for (int i = 0; i < j; i++) cout << x[i] << " ";
  cout << '\n' << k - (n % 2) << '\n';
  for (int i = 0; i < k - (n % 2); i++) cout << y[i] << " ";
  return 0;
}
