n,m = map(int,input().split()) wa = []; ac = []; i = j = 0 for v in input(): if v=="W": wa.append(v) elif v=="C": ac.append(v) elif i