#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6 + 5;
const long long int INF = 1e15;
const long long int mod = 1e9 + 7;
const double PI = 3.14159265358979323846;
template <typename T>
T power(T x, T y, long long int m) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1LL;
    x = (x * x) % m;
  }
  return ans % m;
}
long long int n;
pair<long long int, long long int> p[N];
int main() {
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i + 1;
  }
  sort(p, p + n);
  vector<long long int> odd, eve;
  for (long long int i = 0; i < n; i++) {
    if (i % 2) {
      odd.push_back(p[i].second);
    } else {
      eve.push_back(p[i].second);
    }
  }
  cout << odd.size() << endl;
  for (long long int i = 0; i < odd.size(); i++) {
    cout << odd[i] << " ";
  }
  cout << endl;
  cout << eve.size() << endl;
  for (long long int i = 0; i < eve.size(); i++) {
    cout << eve[i] << " ";
  }
}
