#include <bits/stdc++.h>
using namespace std;
int binarySearch(int arr[], int l, int r, int x) {
  if (r >= l) {
    int mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
bool isPowerOfTwo(int n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
int gcd(int a, int b) {
  if (a < b)
    return gcd(b, a);
  else if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
void print(bool n) {
  if (n) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, p;
    cin >> n;
    p = 2 * n;
    int arr[2 * n];
    for (int i = 0; i < 2 * n; i++) {
      cin >> arr[i];
    }
    unordered_set<int> vm;
    for (int i = 0; i < p; i++) {
      k = arr[i];
      if (vm.find(k) == vm.end()) {
        vm.insert(k);
        cout << arr[i] << " ";
      }
    }
    cout << "\n";
  }
}
