Walter White finally broke bad and finished building his drug empire.
There are $$$5$$$ of them in the business right now: Walt, Jesse, Mike, Saul, and Todd. They divided Albuquerque into $$$n\times n$$$ cells, and they made $$$a_{i, j}$$$ dollars in the area on the intersection of the $$$i$$$-th row and $$$j$$$-th column.
They want to choose $$$n$$$ cells to collect money from. To not cause Hank's suspicion, they want exactly one selected cell in each row and in each column. If the total money made in these cells is $$$S$$$, they will split it evenly among the five of them, and will donate the remaining $$$S\bmod 5$$$ dollars to Ted Beneke.
Find all possible amounts of dollars that could have been donated to Ted Beneke.
The first line contains a single positive integer $$$n$$$ ($$$1 \leq n \leq 10^3$$$) — the size of the grid.
The next $$$n$$$ lines contain $$$n$$$ integers $$$a_{i, j}$$$ ($$$0 \leq a_{i, j} \leq 4$$$) — the number of dollars made in the cell at the intersection of the $$$i$$$-th row and $$$j$$$-th column.
Output a string of exactly 5 letters Y or N. If it's possible to get $$$S \equiv i \bmod 5$$$ for $$$(0 \le i \lt 5)$$$, the $$$i$$$-th letter of the string must be Y, otherwise N.
20 44 0
YNNYN
21 11 1
NNYNN