#include <bits/stdc++.h>
using namespace std;
int a[100], k[100];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t, n;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> n;
    n *= 2;
    for (int j = 0; j < n; ++j) cin >> a[j];
    for (int j = 0; j < n; ++j) {
      if (k[a[j]] == 0) {
        cout << a[j] << ' ';
        ++k[a[j]];
      }
    }
    cout << '\n';
    for (int j = 0; j <= 100; ++j) k[j] = 0;
  }
  return 0;
}
