#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {-1, 0, 0, 1, 1, 1, -1, -1};
const int dy[8] = {0, -1, 1, 0, -1, 1, -1, 1};
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    int i, a;
    vector<int> odd, even;
    for (i = 1; i <= 2 * n; i++) {
      cin >> a;
      if (a % 2 == 0)
        even.push_back(i);
      else
        odd.push_back(i);
    }
    int count = 0;
    if (odd.size() >= 2) {
      for (i = 0; i < odd.size() - 1; i = i + 2) {
        if (count == n - 1) break;
        cout << odd[i] << " " << odd[i + 1] << endl;
        count++;
      }
    }
    if (even.size() >= 2) {
      for (i = 0; i < even.size() - 1; i = i + 2) {
        if (count == n - 1) break;
        cout << even[i] << " " << even[i + 1] << endl;
        count++;
      }
    }
  }
  return 0;
}
