#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int *hash = new int[51];
    for (int i = 1; i <= 50; i++) {
      hash[i] = -1;
    }
    int *a = new int[2 * n];
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
      hash[a[i]] = 1;
    }
    for (int i = 0; i < 2 * n; i++) {
      if (hash[a[i]] == 1) {
        cout << a[i] << " ";
        hash[a[i]] = -1;
      }
    }
    cout << endl;
  }
}
