checks all four points connected with input [ i ] [ j ]
for ( int u = 0 ; u < 4 ; u ++ ) if ( is_valid ( i + y_move [ u ] , j + x_move [ u ] , x , input ) ) BFS ( x , y , i + y_move [ u ] , j + x_move [ u ] , input ) ; }