function Msk = mask3(N)
Msk = zeros(N,N,N);
for k3=1:N
    Msk(1:k3-1,1:k3-1,k3) = 3*reshape(mask2(k3-1),k3-1,k3-1,1);
    
    Msk(1:k3-1,k3,k3) = 3;
    
    Msk(k3,k3,k3) = 1;
end;   