#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int f = 0; f < t; f++) {
    bool x = 1;
    int n;
    cin >> n;
    int a[2 * n], answer[2 * n];
    for (int i = 0; i < 2 * n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < 2 * n; i++) {
      for (int ii = i + 1; ii < 2 * n; ii++) {
        if (a[i] == a[ii]) {
          x = 0;
        }
      }
      if (x) {
        answer[i] = a[i];
      } else {
        answer[i] = 0;
      }
      x = 1;
    }
    for (int i = 0; i < 2 * n; i++) {
      if (answer[i] != 0) {
        cout << answer[i] << endl;
      }
    }
  }
}
