#include <bits/stdc++.h>
using namespace std;
map<long long,bool> a;
long long s[1000000];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
int b;
cin>>b;
for(int j=0;j<b;j++){
cin>>s[j];
a[s[j]]++;
}for(int j=0;j<b;j++){
if(a[s[j]]!=0){
cout<<s[j]<<" ";
a[s[j]]=0;
continue;
}else{
}
}
}
}