#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0;
    cin >> n;
    vector<pair<long long int, long long int>> a(n);
    for (i = 0; i < n; i++) {
      cin >> a[i].first;
      a[i].second = i + 1;
    }
    sort(a.begin(), a.end());
    cout << n - n / 2 << '\n';
    for (i = 0; i < n; i += 2) {
      cout << a[i].second << " ";
    }
    cout << '\n';
    cout << n / 2 << '\n';
    for (i = 1; i < n; i += 2) {
      cout << a[i].second << " ";
    }
  }
}
