include <stdio.h>
int main(void) {
// your code goes here
int t;
scanf(“%d”, &t);
for(t;t>0;t--){
int max=0;
int n;
scanf("%d", &n);
int d[n];
int a[n];
int tcounter=0;
int times[n][2];
int tf=0;
for (int c=0; c<n;c++){
tf=0;
scanf("%d", &a[c]);
for (int z=0; z<=tcounter;z++){
if (a[c]==times[z][0]){
tf=1;
times[z][1] +=1;
}
}
if (tf!=1){
times[tcounter][0]=a[c];
times[tcounter][1]=1;
tcounter+=1;
tf=0;
}
tf=0;
}
for (int c=0; c<n;c++){
tf=0;
scanf("%d", &d[c]);
for (int z=0; z<=tcounter;z++){
if (d[c]==times[z][0]){
tf=1;
times[z][1] +=1;
}
}
if (tf!=1){
times[tcounter][0]=d[c];
times[tcounter][1]=1;
tcounter+=1;
tf=0;
}
tf=0;
}
for (int c=0; c<tcounter;c++){
if (max<times[c][1]){
max= times[c][1];
}
}
// for (int c=0; c<n;c++){
// scanf("%d", &a[c]);
// }
printf("%d\n", max);
}
return 0;
}