N,M=map(int,input().split()) S=input() W,A,C=[],[],[] for i in range(2*N+2*M): if S[i]=="W": W.append(i) if S[i]=="A": A.append(i) if S[i]=="C": C.append(i) if all(i