private static void fillWithConstraints(boolean[][] toFill, boolean[][] constraint, int x, int y){
        if ((x<0 || x>=toFill.length || y<0 || y>=toFill.length) ||
                constraint[x][y] || toFill[x][y])return;
        toFill[x][y]=true;
        fillWithConstraints(toFill, constraint, x+1, y);
        fillWithConstraints(toFill, constraint, x-1, y);
        fillWithConstraints(toFill, constraint, x, y+1);
        fillWithConstraints(toFill, constraint, x, y-1);
    }