~/algor $ cat problems/SYj6FgzSqb8W
k in a row
Each cell of an board holds X, O or . (an empty cell). If equal symbols stand in a row (with no other cell between them) horizontally, vertically or along a diagonal of either direction, the owner of that symbol wins. Print the winner's symbol; if there is no winner, print -.
Input
The first line contains two positive integers: and . Each of the next lines contains a string of characters (X, O or .).
Output
One character: X, O or -.
Note
the two symbols never win at the same time
Examples
3 3 XOX OXO O.X
X
4 3 XO.. .OX. X... .O.X
-