import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static int W; static int H; static int[] dx = {-1,1,0,0}; static int[] dy = {0,0,-1,1}; public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { String[] line = stdReader.readLine().split(" "); W = Integer.parseInt(line[0]); H = Integer.parseInt(line[1]); int[][] board = new int[H][W]; for(int i=0;i=0 && x+dx[i]=0 && y+dy[i]