#include <bits/stdc++.h>
using namespace std;
long long t, n, a[2009], sz;
vector<int> even;
vector<int> odd;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= 2 * n; i++) {
      cin >> a[i];
      if (a[i] % 2 == 0)
        even.push_back(i);
      else
        odd.push_back(i);
    }
    sz = even.size();
    if (sz % 2 == 0 && sz > 0) {
      even.pop_back();
      even.pop_back();
    } else if (sz == 0) {
      odd.pop_back();
      odd.pop_back();
    } else {
      even.pop_back();
      odd.pop_back();
    }
    while (!even.empty()) {
      cout << even.back() << " ";
      even.pop_back();
      cout << even.back() << "\n";
      even.pop_back();
    }
    while (!odd.empty()) {
      cout << odd.back() << " ";
      odd.pop_back();
      cout << odd.back() << "\n";
      odd.pop_back();
    }
  }
  return 0;
}
