#include <bits/stdc++.h>
using namespace std;
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
double gcd(double a, double b) {
  if (b == 0) return a;
  return gcd(b, double(int(a) % int(b)));
}
long long int MOD = 1000000007;
long long int power(long long int b, long long int e, long long int m) {
  if (e == 0) return 1;
  if (e & 1) return b * power(b * b % m, e / 2, m) % m;
  return power(b * b % m, e / 2, m);
}
void solve() {
  long long int n;
  cin >> n;
  ;
  long long int c;
  vector<pair<long long int, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    cin >> c;
    v.push_back({c, i + 1});
  }
  sort(v.begin(), v.end());
  if (n == 2) {
    cout << "1" << '\n'
         << v[0].second << '\n'
         << "1" << '\n'
         << v[1].second << '\n';
    return;
  }
  if (n % 2 != 0)
    cout << (n + 1) / 2 << '\n';
  else
    cout << n / 2 << '\n';
  for (int i = 0; i < n; i += 2) cout << v[i].second << " ";
  cout << '\n' << n / 2 << '\n';
  for (int i = 1; i < n; i += 2) cout << v[i].second << " ";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  for (long long int I = 0; I < t; I++) {
    solve();
  }
  return 0;
}
