#include <bits/stdc++.h>
using namespace std;
int _arr[51];
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int arr[n * 2];
    for (int j = 0; j < n * 2; j++) cin >> arr[j];
    _arr[0] = arr[0];
    int flag = 1;
    for (int j = 1; j < n * 2; j++) {
      bool check = true;
      for (int c = 0; c < flag; c++) {
        if (arr[j] == _arr[c]) {
          check = false;
          break;
        }
      }
      if (check) {
        _arr[flag] = arr[j];
        flag++;
      }
    }
    for (int j = 0; j < flag; j++) {
      cout << _arr[j] << " ";
    }
    cout << endl;
  }
  return 0;
}
