#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define F first
#define S second
#define sz(x) int(x.size())
string odg[2]={"ne", "da"};
int n, q;
string s, t;
signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> q;
	cin >> s >> t;
	vector<ll> d(n);
	for(int i=0; i<n; i++) {
		d[i]=t[i]-s[i];
	}
	// for(int i=0; i<n; i++) {
	// 	cout << d[i] << '\n';
	// }
	ll even=0;
	ll odd=0;
	for(int i=0; i<n; i+=2) {
		even+=d[i];
	}
	even%=26;
	even=(even+26)%26;
	for(int i=1; i<n; i+=2) {
		odd+=d[i];
	}
	odd=(odd+26)%26;
	// cout << odd << ' ' << even << '\n';
	cout << odg[even==odd] << '\n';
	while(q--) {
		int p;
		char c;
		cin >> p >> c;
		p--;
		if(p%2==0) {
			even-=t[p]-s[p];
			s[p]=c;
			even+=t[p]-s[p];
			even%=26;
			even=(even+26)%26;
		}
		else {
			odd-=t[p]-s[p];
			s[p]=c;
			odd+=t[p]-s[p];
			odd%=26;
			odd=(odd+26)%26;
		}
		// cout << odd << ' ' << even << '\n';
		cout << odg[even==odd] << '\n';
	}
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |