function [X1,fail] = wan(A,r,M,alpha,K)

tol = 0.5/alpha; X1 = zeros(1,K); norm = inf;
for k = 1:K
    [xi,fail] = pri(A,r,tol,10,M,norm); if fail, break; end
    xi = round(alpha*xi); r = alpha*r-A*xi;
    X1(k) = xi(1);
end