#include <bits/stdc++.h>
using namespace std;
long long n, t;
long long a[300], p[300], x[300], f;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    f = 0;
    memset(a, 0, sizeof(a));
    memset(x, 0, sizeof(a));
    memset(p, 0, sizeof(a));
    for (int i = 1; i <= n * 2; i++) {
      cin >> a[i];
      if (!x[a[i]]) {
        p[++f] = a[i];
        x[a[i]] = 1;
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << p[i];
      if (i != n) cout << " ";
    }
    cout << endl;
  }
  return 0;
}
