#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int ts;
  cin >> ts;
  while (ts--) {
    long long n, i, vis[500] = {0}, a;
    cin >> n;
    for (i = 1; i <= 2 * n; i++) {
      cin >> a;
      if (vis[a] == 0) {
        cout << a << " ";
      }
      vis[a] = 1;
    }
    cout << endl;
  }
}
