#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
const long double PI = acos(-1);
const long long MOD = 1000000000 + 7;
const int maxn = 1e5;
int n;
pair<int, int> a[maxn];
int main() {
  scanf("%d", &(n));
  for (int i = 0; i < (int)n; ++i) {
    scanf("%d", &(a[i].first));
    a[i].second = i;
  }
  sort(a, a + n);
  vector<int> teams[2];
  for (int i = 0; i < (int)n; ++i) teams[i % 2].push_back(a[i].second + 1);
  printf("%d\n", int(teams[0].size()));
  for (auto& val : teams[0]) printf("%d ", val);
  printf("\n%d\n", int(teams[1].size()));
  for (auto& val : teams[1]) printf("%d ", val);
  return 0;
}
