#include <bits/stdc++.h>
using namespace std;
void print() {
  int n;
  cin >> n;
  int a[2 * n];
  int b[150] = {0};
  for (int i = 0; i < 2 * n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < 2 * n; i++) {
    if (b[a[i]] == 0) {
      cout << a[i] << " ";
      b[a[i]]++;
    }
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) print();
  return 0;
}
