#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e9 + 9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<pair<long long int, long long int>> even, odd;
    for (long long int i = 0; i < 2 * n; ++i) {
      long long int x;
      cin >> x;
      if (x & 1)
        odd.push_back({x, i + 1});
      else
        even.push_back({x, i + 1});
    }
    long long int odd_sz = odd.size();
    long long int even_sz = even.size();
    if (odd_sz & 1) {
      odd.pop_back();
      even.pop_back();
    } else if (odd_sz) {
      odd.pop_back();
      odd.pop_back();
    } else {
      even.pop_back();
      even.pop_back();
    }
    while (odd.size()) {
      cout << odd.back().second << " ";
      odd.pop_back();
      cout << odd.back().second << " ";
      cout << "\n";
      odd.pop_back();
    }
    while (even.size()) {
      cout << even.back().second << " ";
      even.pop_back();
      cout << even.back().second << " ";
      cout << "\n";
      even.pop_back();
    }
  }
  return 0;
}
