#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int64_t t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int64_t a[2 * n];
    vector<int64_t> map[2];
    for (int64_t i = 0; i < 2 * n; i++) {
      cin >> a[i];
      if (a[i] & 1)
        map[0].push_back(i + 1);
      else
        map[1].push_back(i + 1);
    }
    if (map[0].size() & 1)
      map[0].erase(map[0].end() - 1), map[1].erase(map[1].end() - 1);
    else {
      if (map[1].size() >= 2) {
        map[1].erase(map[1].end() - 1);
        map[1].erase(map[1].end() - 1);
      } else {
        map[0].erase(map[0].end() - 1);
        map[0].erase(map[0].end() - 1);
      }
    }
    vector<pair<int64_t, int64_t>> ans;
    for (int64_t i = 0; i < 2; i++) {
      for (int64_t j = 0; j < map[i].size(); j += 2) {
        ans.push_back({map[i][j], map[i][j + 1]});
      }
    }
    for (int64_t i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << "\n";
    }
  }
  return 0;
}
