#include using namespace std; typedef long long ll; typedef long double ld; #define REP(i, N) for(int i=0;i<(N);++i) #define FOR(i, a, b) for(int i=(a);i<=(b);++i) #define FORI(i, a, b) for(int i=(a);i<(b);++i) #define FORD(i, a, b) for(int i=(b)-1;i>=(a);--i) char str[1100100]; void solve(){ int L=strlen(str); int carry = 0; if(str[L-1] == '1') str[L-1]='0', carry=1; else str[L-1]='1'; for(int p=L-1; p>=0 && carry; p-=2){ if(str[p-1]=='0' && str[p-2]=='0') str[p-1]='1',str[p-2]='1', carry=0; else if(str[p-1]=='1' && str[p-2]=='0') str[p-1]='0',str[p-2]='0', carry=0; else if(str[p-1]=='0' && str[p-2]=='1') str[p-1]='1',str[p-2]='0', carry=1; else if(str[p-1]=='1' && str[p-2]=='1') str[p-1]='0',str[p-2]='1', carry=0; } for(int i=0;i