#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t, n, x;
  cin >> t;
  while (t-- > 0) {
    cin >> n;
    vector<int> oddarr, evenarr;
    for (int i = 1; i <= 2 * n; i++) {
      cin >> x;
      if (x & 1)
        oddarr.push_back(i);
      else
        evenarr.push_back(i);
    }
    bool done = false;
    int oddlen = oddarr.size(), evenlen = evenarr.size();
    if (oddlen & 1) {
      oddarr.pop_back();
      evenarr.pop_back();
      done = true;
    }
    if (done == false) {
      if (oddlen == 0) {
        evenarr.pop_back();
        evenarr.pop_back();
      } else {
        oddarr.pop_back();
        oddarr.pop_back();
      }
    }
    for (int i = 0; i < evenarr.size(); i += 2) {
      cout << evenarr[i] << " " << evenarr[i + 1] << endl;
    }
    for (int i = 0; i < oddarr.size(); i += 2) {
      cout << oddarr[i] << " " << oddarr[i + 1] << endl;
    }
  }
  return 0;
}
