#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 11;
const int MOD = 1e9 + 7;
vector<int> v1, v2;
pair<int, int> a[maxN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first, a[i].second = i;
  sort(a, a + n);
  reverse(a, a + n);
  int one = 0, two = 0;
  for (int i = 0; i < n - 1; i += 2) {
    if (one >= two) {
      one += a[i + 1].first;
      two += a[i].first;
      v1.push_back(a[i + 1].second);
      v2.push_back(a[i].second);
    } else {
      one += a[i].first;
      two += a[i + 1].first;
      v1.push_back(a[i].second);
      v2.push_back(a[i + 1].second);
    }
  }
  if (n % 2) {
    if (one >= two) {
      v2.push_back(a[n - 1].second);
    } else
      v1.push_back(a[n - 1].second);
  }
  cout << v1.size() << "\n";
  for (int y : v1) cout << y + 1 << " ";
  cout << "\n";
  cout << v2.size() << "\n";
  for (int y : v2) cout << y + 1 << " ";
  cout << "\n";
  return 0;
}
