#include <bits/stdc++.h>
#define maxn 100010
using namespace std;
int t;
void solve(){
	int n;scanf("%d",&n);
	char a[maxn],b[maxn],c[maxn],d[maxn];
	int anum0 = 0,bnum0 = 0,anum1 = 0,bnum1 = 0,anum2 = 0,bnum2 = 0,anum3 = 0,bnum3 = 0;
	int anum01 = 0,bnum01 = 0,anum11 = 0,bnum11 = 0;
	scanf(" %s",a+1);
	scanf(" %s",b+1);
	scanf(" %s",c+1);
	scanf(" %s",d+1);
	printf("%d\n",n);
}
int main(){
	freopen("edit.in","r",stdin);
	freopen("edit.out","w",stdout);
	scanf("%d",&t);
	while(t--){
		solve();
	}
	return 0;
}
