#include #include int main(){ int N,M; char s[51]; scanf("%d %d",&N,&M); for(int i=0;i