#include #include using namespace std; const int maxn=6500; int d,s,b,n,kase; char data[7][maxn]; bool parity; bool read() { scanf("%d%d%d\n",&d,&s,&b); if(!d) return false; memset(data,0,sizeof(data)); parity=getchar()=='O',n=s*b; for(int i=0;i