#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > A(n);
  for (int i = 0; i < n; ++i) {
    cin >> A[i].first;
    A[i].second = i + 1;
  }
  sort(A.begin(), A.end());
  int teamA, teamB;
  teamA = teamB = 0;
  vector<int> memA, memB;
  for (int i = n - 1; i > 0; i -= 2) {
    if (teamA >= teamB) {
      memB.push_back(A[i].second);
      memA.push_back(A[i - 1].second);
      teamB += A[i].first;
      teamA += A[i - 1].first;
    } else {
      memA.push_back(A[i].second);
      memB.push_back(A[i - 1].second);
      teamA += A[i].first;
      teamB += A[i - 1].first;
    }
  }
  if (n & 1) {
    if (teamA >= teamB)
      memB.push_back(A[0].second);
    else
      memA.push_back(A[0].second);
  }
  printf("%d\n", memA.size());
  for (int i = 0; i < memA.size(); ++i) printf("%d ", memA[i]);
  printf("\n");
  printf("%d\n", memB.size());
  for (int i = 0; i < memB.size(); ++i) printf("%d ", memB[i]);
  printf("\n");
  return 0;
}
