#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull = unsigned long long;
int a[1007];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<pair<int, int> > odd, even;
    for (int i = 1; i <= 2 * n; i++) {
      int first;
      cin >> first;
      if (first & 1)
        odd.push_back({first, i});
      else
        even.push_back({first, i});
    }
    int k = n - 1;
    for (int i = 0; k > 0 && i < (int)odd.size() - 1; i += 2, k--) {
      cout << odd[i].second << " " << odd[i + 1].second << endl;
    }
    for (int i = 0; k > 0 && i < (int)even.size() - 1; i += 2, k--) {
      cout << even[i].second << " " << even[i + 1].second << endl;
    }
  }
  return 0;
}
