#include <bits/stdc++.h>
using namespace std;
set<int> p;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    p.clear();
    vector<int> v;
    int n;
    cin >> n;
    for (int i = 0; i < 2 * n; i++) {
      int x;
      cin >> x;
      if (p.find(x) == p.end()) {
        p.insert(x);
        v.push_back(x);
      }
    }
    for (auto xx : v) cout << xx << " ";
    cout << endl;
  }
  return 0;
}
