Field Day

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Each of Farmer John's NN barns (2N1052\le N\le 10^5) has selected a team of CC cows (1C181\le C\le 18) to participate in field day. The breed of every cow is either a Guernsey or a Holstein.

The difference between two teams is defined to be the number of positions ii (1iC1 \leq i \leq C) at which the breeds of the cows in the iith positions differ. For every team tt from 1N1 \ldots N, please compute the maximum difference between team tt and any other team.

입력

The first line contains CC and NN.

The next NN lines each contain a string of length CC of Gs and Hs. Each line corresponds to a team.

출력

For each team, print the maximum difference.

힌트

The first and third teams differ by 55. The second and third teams differ by 33.