#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int i, j, n, d;
    cin >> n;
    long long int a[2 * n];
    for (long long int i = 0; i < 2 * n; i++) cin >> a[i];
    vector<long long int> v;
    v.push_back(a[0]);
    for (i = 1; i < 2 * n; i++) {
      d = 0;
      for (j = 0; j < i; j++) {
        if (a[i] == a[j]) d = 1;
      }
      if (d == 0) v.push_back(a[i]);
    }
    for (long long int i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
  }
  return 0;
}
