#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a;
vector<int> one, two;
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    a.push_back(make_pair(temp, i + 1));
  }
  sort(a.begin(), a.end());
  long long int cnt = 0, total = 0;
  for (i = n - 1; i >= 0; i -= 2) {
    if (i == 0) break;
    if (total >= 0) {
      one.push_back(a[i - 1].second);
      two.push_back(a[i].second);
      total = total + a[i - 1].second - a[i].second;
    } else {
      one.push_back(a[i].second);
      two.push_back(a[i - 1].second);
      total = total + a[i].second - a[i - 1].second;
    }
    cnt++;
  }
  if (n % 2 == 1) {
    if (total < 0)
      one.push_back(a[0].second);
    else
      two.push_back(a[0].second);
  }
  int len1 = one.size(), len2 = two.size();
  cout << len1 << endl;
  for (i = 0; i < len1; i++) cout << one[i] << " ";
  cout << endl;
  cout << len2 << endl;
  for (i = 0; i < len2; i++) cout << two[i] << " ";
  cout << endl;
  return 0;
}
