#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[2 * n + 5];
    for (int i = 0; i < 2 * n; i++) {
      cin >> arr[i];
    }
    set<int> s1;
    for (int i = 0; i < 2 * n; i++) {
      if (s1.find(arr[i]) != s1.end()) {
        continue;
      } else {
        cout << arr[i] << " ";
        s1.insert(arr[i]);
      }
    }
    cout << endl;
  }
}
