#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    n *= 2;
    set<int> s;
    vector<int> v;
    while (n--) {
      int a;
      cin >> a;
      if (s.count(a) == 0) v.push_back(a);
      s.insert(a);
    }
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
}
