program giftcard;
var N,C1,C2,N1,N2,MCD:int64;
procedure Euclide_Bezout (a, b, c:int64;var MCD:int64; var k:int64; var h:int64);
var x,app:int64;
begin
if a<b then begin app:=a; a:=b; b:=app; end;
if b=0 then
begin
if c mod a=0 then
begin
MCD:=a;
k:=c div a;
h:=1;
exit
end;
end;
Euclide_Bezout(b,a mod b,c,MCD,k,h);
h:=h-k*(a div b);
x:=(h-1) div (a div MCD);
k:=k+x*(b div MCD);
h:=h-x* (a div MCD);
writeln(k,' ',h);
if (K<=0) or (k>(c div a)) then exit;
if (h<0) or (h>(a div MCD)) then exit;
if (k*a+h*b<>c) then exit;
end;
begin
readln(N,C1,C2);
N1:=10000; N2:=0;
Euclide_Bezout(C1,C2,N,MCD,N1,N2);
writeln(MCD);
writeln(N1,' ',N2);
end.
cHJvZ3JhbSBnaWZ0Y2FyZDsKdmFyIE4sQzEsQzIsTjEsTjIsTUNEOmludDY0OyAKcHJvY2VkdXJlIEV1Y2xpZGVfQmV6b3V0IChhLCBiLCBjOmludDY0O3ZhciAgTUNEOmludDY0OyB2YXIgazppbnQ2NDsgdmFyIGg6aW50NjQpOwp2YXIgeCxhcHA6aW50NjQ7CmJlZ2luIAogIGlmIGE8YiB0aGVuIGJlZ2luIGFwcDo9YTsgYTo9YjsgYjo9YXBwOyBlbmQ7CiAgaWYgYj0wIHRoZW4gCiAgICAgICAgICAgYmVnaW4KICAgICAgICAgICAgIGlmIGMgbW9kIGE9MCB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVnaW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DRDo9YTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGs6PWMgZGl2IGE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoOj0xOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhpdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZDsKICAgICAgICAgICAgZW5kOwogRXVjbGlkZV9CZXpvdXQoYixhIG1vZCBiLGMsTUNELGssaCk7CiBoOj1oLWsqKGEgZGl2IGIpOwogeDo9KGgtMSkgZGl2IChhIGRpdiBNQ0QpOwogazo9ayt4KihiIGRpdiBNQ0QpOwogaDo9aC14KiAoYSBkaXYgTUNEKTsKIHdyaXRlbG4oaywnICcsaCk7CiBpZiAoSzw9MCkgb3IgKGs+KGMgZGl2IGEpKSB0aGVuIGV4aXQ7CiBpZiAoaDwwKSBvciAoaD4oYSBkaXYgTUNEKSkgdGhlbiBleGl0OwogaWYgKGsqYStoKmI8PmMpIHRoZW4gZXhpdDsKICAKZW5kOyAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgIApiZWdpbgoJcmVhZGxuKE4sQzEsQzIpOwogICAgTjE6PTEwMDAwOyBOMjo9MDsKCUV1Y2xpZGVfQmV6b3V0KEMxLEMyLE4sTUNELE4xLE4yKTsKCXdyaXRlbG4oTUNEKTsKCXdyaXRlbG4oTjEsJyAnLE4yKTsKZW5kLgo=