#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[2 * n];
    vector<bool> vec(55, false);
    vector<int> v;
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
      if (!vec[a[i]]) {
        v.push_back(a[i]);
        vec[a[i]] = true;
      }
    }
    for (int i = 0; i < v.size(); i++) {
      cout << v[i] << " ";
    }
    cout << endl;
  }
}
