public void test(int down, int left, int right) {
        if(down == fill){
            sum ++;
            return;
        }

        int canNot = down | left | right;
        if(canNot == fill)
            return;
        for (int i = 0; i < n; i++) {
            int put = 1 << i;
            if ((canNot & put) == 0) {
                test((down | put), (left | put) << 1, (right | put) >>> 1);
            }
        }
    }