#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i;
  cin >> t;
  for (i = 0; i < t; i++) {
    int n;
    cin >> n;
    int a[2 * n], j;
    for (j = 0; j < 2 * n; j++) {
      cin >> a[j];
    }
    int b[n], k, l = 1, p;
    b[0] = a[0];
    for (k = 1; k < 2 * n && l < n; k++) {
      for (p = 0; p < l; p++) {
        if (a[k] == b[p])
          break;
        else
          continue;
      }
      if (p == l) {
        b[l] = a[k];
        l++;
      } else
        continue;
    }
    for (int m = 0; m < n; m++) {
      cout << b[m] << " ";
    }
    cout << "" << endl;
  }
  return 0;
}
