#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; void solve(){ ll N, a, b; string S; cin >> N >> S; for (int i=0; i=0; i--){ if (S[i] != '?') continue; a = (i+1) % N; b = (i+2) % N; if (S[a] == S[b] && S[a] != '?'){ S[i] = (S[a] == '1' ? '0' : '1'); } } for (int i=0; i> T; while(T){ T--; solve(); } return 0; }