function [r] = fourtwo (x)
for i = 1:3
    for j = 1:3
        for k = 1:3
            for l = 1:3
                r((i-1)*3+k,(j-1)*3+l) = x(i,j,k,l);
            end
        end
    end
end