popcount=lambda x:bin(x).count("1") def solve(S,T,N): l=0; r=1<>1 if T