#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    n *= 2;
    int arr[n];
    for (int i = 0; i < n; ++i) cin >> arr[i];
    map<int, int> mp;
    for (auto x : arr) {
      if (mp[x]) continue;
      cout << x << " ";
      mp[x] = 1;
    }
    cout << '\n';
  }
  return 0;
}
