input n;
dim a(n+1),b(n+4),c(b+4);
input e;
for i:=n+1 to 1 step -1;
input a(i);
next i;
if n<3 then l1;
input p,q:
b(1):=0;
b(2):=1;
c(1):=0;
c(2):=1;
n:=n+1;
label l2;
for i:=1 to n-1;
k:=i+2;
b(k):=a(i+1)-p*b(k-1)-q*b(k-2);
c(k):=b(k)-p*c(k-1)-q*c(k-2);
print b(k),c(k);
next i;
n:=n+1;
c1:=c(n-1)-b(n-1);
d:=c(n-2)*c(n-2)-c1*c(n-3);
d1:=b(n-1)*c(n-2)-b(n)*c(n-3);
d2:=-b(n-1)*c1+b(n)*c(n-2);
d3:=d1/d;
d4:=d2/d;
n:=n-1;
print d,d1,d2,d3,d4;
p:=p+d3;
q:=q+d4;
if abs(d3/p)>e or abs(d4/q)>e then l2;
gosub l3;
n:=n-2;
if n:=2 then l4;
if n:=3 then l5;
for i:=2 to n;
a(i):=b(i+1);
next i;
goto l2;
label l5;
p:=b(3);
q:=b(4);
gosub l3;
end;
label l4;
print -b(4)/b(3);
end;
label l1;
if n=1 then print -a(1);:end;
p:=a(2);
q:=a(3);
gosub l3;
end;
label l3;
w:=p^2-4*q;
w1:=abs(w);
r:=sqr(w1);
if w<0 then l6;
r1:=0.5*(-p+r);
r2:=0.5*(-p-r);
i1:=0;
i2:=0;
goto l7;
label l6;
r1:=-0.5*p;
r2:=r1;
i1:=0.5*r;
i2:=-0.5*r;
label l7;
print r1,i1;
print r2,i2;
return;