#include using namespace std; const int maxn = 20020; int vis[maxn], ans[maxn]; vector e[1010]; int main(void) { //freopen("c.in","r",stdin); int T; scanf("%d",&T); while (T--) { for (int i=0;i<1000;i++) e[i].clear(); int n; scanf("%d",&n); for (int i=1;i<=n;i++) { int m; scanf("%d",&m); for (int j=0;j