#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, ara[101], i, j, c = 0;
    cin >> n;
    for (i = 0; i < 2 * n; i++) {
      cin >> ara[i];
    }
    for (i = 0; i < 2 * n; i++) {
      if (ara[i] != 0) cout << ara[i] << " ";
      for (j = i + 1; j < 2 * n; j++) {
        if (ara[j] == ara[i]) {
          ara[j] = 0;
        }
      }
    }
    cout << endl;
  }
  return 0;
}
