#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<pair<int, int>> odd, even;
    for (int i = 0; i < 2 * n; i++) {
      int num;
      cin >> num;
      if (num % 2 == 0) {
        odd.push_back(make_pair(num, i + 1));
      } else {
        even.push_back(make_pair(num, i + 1));
      }
    }
    if (odd.size() % 2 == 0) {
      if (odd.size() > 0) {
        odd.pop_back();
        odd.pop_back();
        int i = 0;
        while (i + 1 < odd.size()) {
          cout << odd[i].second << " " << odd[i + 1].second << endl;
          i += 2;
        }
        i = 0;
        while (i + 1 < even.size()) {
          cout << even[i].second << " " << even[i + 1].second << endl;
          i += 2;
        }
      } else {
        even.pop_back();
        even.pop_back();
        int i = 0;
        while (i + 1 < even.size()) {
          cout << even[i].second << " " << even[i + 1].second << endl;
          i += 2;
        }
      }
    } else {
      odd.pop_back();
      even.pop_back();
      int i = 0;
      while (i + 1 < odd.size()) {
        cout << odd[i].second << " " << odd[i + 1].second << endl;
        i += 2;
      }
      i = 0;
      while (i + 1 < even.size()) {
        cout << even[i].second << " " << even[i + 1].second << endl;
        i += 2;
      }
    }
  }
}
