#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v.push_back({x, i + 1});
  }
  vector<long long int> a, b;
  long long int sa = 0, sb = 0;
  sort(v.begin(), v.end());
  for (long long int i = n - 1; i >= 0; i--) {
    if (sa <= sb) {
      sa += v[i].first;
      a.push_back(v[i].second);
    } else {
      sb += v[i].first;
      b.push_back(v[i].second);
    }
  }
  while (a.size() > b.size() + 1) {
    long long int x = a.back();
    a.pop_back();
    b.push_back(x);
  }
  while (b.size() > a.size() + 1) {
    long long int x = b.back();
    b.pop_back();
    a.push_back(x);
  }
  cout << a.size() << "\n";
  for (auto u : a) cout << u << " ";
  cout << "\n";
  cout << b.size() << "\n";
  for (auto u : b) cout << u << " ";
  return 0;
}
