#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    vector<int> ggvp;
    int n;
    cin >> n;
    vector<int> gg;
    for (int x = 0; x < n * 2; x++) {
      int z;
      cin >> z;
      gg.push_back(z);
      bool have = false;
      for (int v = 0; v < x; v++) {
        if (gg[v] == z) {
          have = true;
        }
      }
      if (have == false) {
        ggvp.push_back(z);
      }
    }
    for (int d = 0; d < n; d++) {
      cout << ggvp[d] << " ";
    }
    cout << "\n";
  }
}
