#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, i, t, c;
  cin >> t;
  while (t--) {
    cin >> n;
    list<int> li;
    m = n * 2;
    for (i = 0; i < m; i++) {
      cin >> s;
      li.push_back(s);
      c = count(li.begin(), li.end(), s);
      if (c == 1) cout << s << " ";
    }
    cout << endl;
  }
}
