#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << '\n';
  err(++it, args...);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    int n;
    cin >> n;
    pair<int, int> arr[n];
    int temp;
    for (int i = 0; i <= n - 1; i++) {
      cin >> temp;
      arr[i] = make_pair(temp, i + 1);
    }
    sort(arr, arr + n);
    vector<int> g1, g2;
    for (int i = 0; i <= n - 1; i++) {
      if (!(i & 1))
        g1.emplace_back(arr[i].second);
      else
        g2.emplace_back(arr[i].second);
    }
    cout << g1.size() << '\n';
    for (int x : g1) cout << x << " ";
    cout << "" << '\n';
    cout << g2.size() << '\n';
    for (int x : g2) cout << x << " ";
    cout << "" << '\n';
  }
  return 0;
}
