#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    gcd(b, a % b);
}
long long lcd(long long a, long long b) { return (a * b) / gcd(a, b); }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a[100] = {0};
    vector<int> v;
    cin >> n;
    for (int i = 0; i < 2 * n; i++) {
      int temp;
      cin >> temp;
      if (a[temp] == 0) v.push_back(temp);
      a[temp] = 1;
    }
    for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << endl;
  }
  return 0;
}
