#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int n;
    cin >> n;
    long long int a[2 * n];
    vector<long long int> v;
    for (long long int i = 0; i < 2 * n; i++) {
      cin >> a[i];
    }
    map<long long int, long long int> mp;
    for (long long int i = 0; i < 2 * n; i++) {
      if (mp.find(a[i]) == mp.end()) {
        mp[a[i]]++;
        v.push_back(a[i]);
      }
    }
    for (long long int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  }
}
