import sys input = sys.stdin.readline N,M=map(int,input().split()) S=[input().strip() for i in range(N)] X=dict() X["P"]="C" X["G"]="P" X["C"]="G" L=list(range(N)) Q=[([],L,0)] while Q: Q.sort(key=lambda x:len(x[1])) now,L,ind=Q.pop() if L==[]: while len(now)