import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { private static int[] table; private static int convertBoardToInt(String inp, int n) { int n2 = n * n; int sum = 0; int[] board = new int[n2]; for (int i = 0; i < n2; i++) { if(hasWon(sum) != 0) return sum; int p = i % 2 + 1; int d = Integer.parseInt(inp.substring(i, i+1), 16); if(n == 3) d--; if (board[d] != 0) re