#include <bits/stdc++.h>
using namespace std;
int a[100005];
bool cmp(const int &i, const int &j) { return a[i] < a[j]; }
int main() {
  ios_base::sync_with_stdio(false);
  int n, pos[100005];
  vector<int> x, y;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    pos[i] = i;
  }
  sort(pos, pos + n, cmp);
  int sumx = 0, sumy = 0;
  for (int i = 0; i < n; i += 2) {
    x.push_back(pos[i]);
    sumx += a[pos[i]];
  }
  for (int i = 1; i < n; i += 2) {
    y.push_back(pos[i]);
    sumy += a[pos[i]];
  }
  cout << (int)x.size() << "\n";
  for (int i = 0; i < (int)x.size(); i++) cout << x[i] + 1 << ' ';
  cout << "\n";
  cout << (int)y.size() << "\n";
  for (int i = 0; i < (int)y.size(); i++) cout << y[i] + 1 << ' ';
  cout << "\n";
  return 0;
}
