string@S,@T,a[4]{};rep[S](s,2)rep[T](t,2){setX{s,t};a[X.count('A')*2+X.count('B')]++;}wt(a[2],a[1],a[3],*a);