#include <bits/stdc++.h>
using namespace std;
bool decSort(long long a, long long b) { return a > b; }
long long max_of_array(long long a[], long long n) {
  long long mx = a[0];
  for (long long i = 0; i < n; i++) {
    if (a[i] > mx) mx = a[i];
  }
  return mx;
}
long long min_of_array(long long a[], long long n) {
  long long mn = a[0];
  for (long long i = 0; i < n; i++) {
    if (a[i] < mn) mn = a[i];
  }
  return mn;
}
bool isPrime(long long n) {
  if (n == 1) return false;
  if (n == 2) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long binaryExponentiation(long long x, long long n) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = result * x;
    x = x * x;
    n = n / 2;
  }
  return result;
}
long long modularExponentiation(long long x, long long n, long long M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modularExponentiation((x * x) % M, n / 2, M);
  else
    return (x * modularExponentiation((x * x) % M, (n - 1) / 2, M)) % M;
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0;
    *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long A, long long M) {
  long long x, y;
  gcdExtended(A, M, &x, &y);
  return (x % M + M) % M;
}
int main() {
  long long t, n, x[100];
  cin >> t;
  for (int i = 0; i < t; i++) {
    int r[51] = {0};
    cin >> n;
    for (int j = 0; j < 2 * n; j++) {
      cin >> x[j];
      if (r[x[j]] == 0) {
        cout << x[j] << " ";
        r[x[j]]++;
      }
    }
    cout << "\n";
  }
  return 0;
}
