#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int T;
  cin >> T;
  while (T--) {
    long long int n;
    cin >> n;
    vector<long long int> o, e;
    for (long long int i = 1; i <= 2 * n; i++) {
      long long int x;
      cin >> x;
      if (x % 2 == 0)
        e.push_back(i);
      else
        o.push_back(i);
    }
    vector<pair<long long int, long long int>> ans;
    for (long long int i = 0; i + 1 < o.size(); i += 2)
      ans.push_back({o[i], o[i + 1]});
    for (long long int i = 0; i + 1 < e.size(); i += 2)
      ans.push_back({e[i], e[i + 1]});
    for (long long int i = 0; i < n - 1; i++)
      cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
