var
a, b, x, y, x1, x2, xx, i : integer;
begin
assign(input,'input.txt'); reset(input);
assign(output,'output.txt'); rewrite(output);
read(x,y);
x1:=0; x2:=1;
for i:=3 to x do
begin xx:=x1+x2; x1:=x2; x2:=xx end;
a:=y div x1; b:=0;
while x1*a+x2*b<>y do
begin
while x1*a+x2*b<y do b:=b+1;
if x1*a+x2*b<>y then begin a:=a-1; b:=0 end
end;
write(a,' ',b)
end.
a, b, x, y, x1, x2, xx, i : integer;
begin
assign(input,'input.txt'); reset(input);
assign(output,'output.txt'); rewrite(output);
read(x,y);
x1:=0; x2:=1;
for i:=3 to x do
begin xx:=x1+x2; x1:=x2; x2:=xx end;
a:=y div x1; b:=0;
while x1*a+x2*b<>y do
begin
while x1*a+x2*b<y do b:=b+1;
if x1*a+x2*b<>y then begin a:=a-1; b:=0 end
end;
write(a,' ',b)
end.