#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, x, temp = 0;
  cin >> n;
  stack<long long> even;
  stack<long long> odd;
  long long i;
  for (i = 1; i <= (2 * n); ++i) {
    cin >> x;
    if (x & 1) {
      if (odd.empty())
        odd.push(i);
      else {
        ++temp;
        cout << odd.top() << " " << i << "\n";
        if (temp == (n - 1)) break;
        odd.pop();
      }
    } else {
      if (even.empty())
        even.push(i);
      else {
        ++temp;
        cout << even.top() << " " << i << "\n";
        if (temp == (n - 1)) break;
        even.pop();
      }
    }
  }
  for (i = i + 1; i <= (2 * n); ++i) {
    cin >> x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, tt = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
