#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n;
  cin >> n;
  vector<int> odd;
  vector<int> even;
  for (int i = 1, k; i <= n * 2; i++) {
    cin >> k;
    if (k % 2 == 1) {
      odd.push_back(i);
    } else {
      even.push_back(i);
    }
  }
  if (odd.size() % 2 == 1) {
    odd.pop_back();
    even.pop_back();
  } else {
    if (odd.size() >= 2) {
      odd.pop_back();
      odd.pop_back();
    } else {
      even.pop_back();
      even.pop_back();
    }
  }
  for (int i = 0; i < odd.size(); i += 2) {
    printf("%d %d\n", odd[i], odd[i + 1]);
  }
  for (int i = 0; i < even.size(); i += 2) {
    printf("%d %d\n", even[i], even[i + 1]);
  }
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    Solve();
  }
  return 0;
}
