#include <bits/stdc++.h>
using namespace std;
const long long N = 2e7;
const long long inf = 1e9;
long long n, sum, ans = 1;
pair<int, int> p[555555];
vector<int> a, b;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int x, y;
  for (int i = 1; i <= n; i++) cin >> x, p[i] = make_pair(x, i);
  sort(p + 1, p + n + 1);
  int sum = 0, mx = 0;
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      a.push_back(p[i].second);
    else
      b.push_back(p[i].second);
  }
  cout << a.size() << endl;
  for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
  cout << endl;
  cout << b.size() << endl;
  for (int i = 0; i < b.size(); i++) cout << b[i] << ' ';
  return 0;
}
