#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;


const int MAXN = 1e5 + 10;
int sn1[MAXN], sn2[MAXN], idx1[MAXN], idx2[MAXN];
int T, n, cnt1, cnt2;
string s1, s2, t1, t2;

int cpr() {
	int res = 0;
	for(int i = 0; i < n; i++) {
		res += (s1[i] == s2[i]);
	}
	return res;
}

int calc(string &s, int op, int l, int r) {
	if(r == l) {
		return s1[l] == s2[r];
	}
	int num1 = 0, num0 = 0;
	if(op == 1) {
		num1 = sn2[r]-sn2[l-1];
	}else{
		num1 = sn1[r]-sn1[l-1];
	}
	num0 = r-l+1-num1;
	
}

void method() {
	cin >> T;
	while(T--) {
		cin >> n >> s1 >> s2 >> t1 >> t2;
		int x = cpr();
		for(int i = 0; i < n; i++) {
			if(t1[i] == '0') {
				idx1[++cnt1] = i;
			}
			if(t2[i] == '0') {
				idx2[++cnt2] = i;
			}
			sn1[i] = sn1[i-1] + (s1[i] == '1');
			sn2[i] = sn2[i-1] + (s2[i] == '1');
		}
		idx1[++cnt1] = idx2[++cnt2] = n+1;
		int l = 1, r = 1, last = 0;
		for(int l = 1, r = 1; l <= cnt1 && r <= cnt2; ) {
			if(idx1[l] < idx2[r]) {
				calc(s1, 1, last, idx2[r]-1);
				last = idx2[r];
				while(idx1[l] < idx2[r] && l <= cnt1) {
					l++;
				}
			}
			if(idx1[l] > idx2[r]) {
				calc(s2, 2, last, idx[l]-1);
				last = idx1[l];
				while(idx1[l] > idx2[r] && r <= cnt2) {
					r++;
				}
			}
		}
	}
}

void dfs1(int d) {
	
}

int main() {
	freopen("edit.in", "r", stdin);
	freopen("edit.out", "w", stdout);
	
	cin >> T;
	while(T--) {
		cin >> n >> s1 >> s2 >> t1 >> t2;
		dfs1(1);
	}
	
	return 0;
} 
