#include <bits/stdc++.h>
using namespace std;
double PI = 3.1415926535897932384626433832795;
vector<pair<int, int> > v;
vector<int> ans1, ans2;
int main() {
  int n, mx = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    pair<int, int> p;
    scanf("%d", &p.first);
    p.second = i + 1;
    v.push_back(p);
    mx = max(mx, p.first);
  }
  sort(v.rbegin(), v.rend());
  long long sum1 = 0, sum2 = 0;
  int i = 0;
  for (; i + 1 < n; i += 2) {
    if (i % 2 == 0)
      ans1.push_back(v[i].second), ans2.push_back(v[i + 1].second);
    else
      ans2.push_back(v[i].second), ans1.push_back(v[i + 1].second);
  }
  if (n % 2 != 0) ans2.push_back(v[i].second);
  cout << ans1.size() << endl;
  for (int i = 0; i < ans1.size(); ++i) cout << ans1[i] << " ";
  cout << endl;
  cout << ans2.size() << endl;
  for (int i = 0; i < ans2.size(); ++i) cout << ans2[i] << " ";
  return 0;
}
