#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a, b;
    for (long long i = 0; i < 2 * n; ++i) {
      long long x;
      cin >> x;
      if (x % 2) {
        a.push_back(i);
      } else {
        b.push_back(i);
      }
    }
    vector<pair<long long, long long>> res;
    for (long long i = 0; i + 1 < a.size(); i += 2) {
      res.push_back({a[i], a[i + 1]});
    }
    for (long long i = 0; i + 1 < b.size(); i += 2) {
      res.push_back({b[i], b[i + 1]});
    }
    for (long long i = 0; i < n - 1; ++i) {
      cout << res[i].first + 1 << " " << res[i].second + 1 << "\n";
    }
  }
}
