from sys import stdin input=lambda :stdin.readline()[:-1] class non_commutative_xor_segment_tree: def __init__(self,n,init,func,E): self.n=n self.N=1<>i)<>i)&1 and L+(1<>20 L1=L&mask R0=R>>20 R1=R&mask res0=L0*pow11[R1]+R0*pow2[L1] res1=L1+R1 res0%=mod return (res0<<20)+res1 seg=non_commutative_xor_segment_tree(n,[(int(S[i])<<20)+1 for i in range(1<>20)