#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
int tc = 1;
int n, x;
vector<int> odd, even;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> tc;
  while (tc--) {
    cin >> n;
    odd.clear();
    even.clear();
    for (int i = 0; i < 2 * n; i++) {
      cin >> x;
      if (x % 2)
        odd.push_back(i + 1);
      else
        even.push_back(i + 1);
    }
    int cnt = 0;
    if (odd.size() > 1) {
      for (int i = 0; i < odd.size() - 1; i += 2) {
        cout << odd[i] << " " << odd[i + 1] << "\n";
        cnt++;
        if (cnt == n - 1) break;
      }
    }
    for (int i = 0; i < even.size() - 1; i += 2) {
      if (cnt == n - 1) break;
      cout << even[i] << " " << even[i + 1] << "\n";
      cnt++;
    }
  }
  return 0;
}
