program giftcard;
var N,C1,C2,N1,N2,MCD:int64;
procedure Euclide_Bezout (a, b, c:int64;var MCD:int64; var h:int64; var k: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,h,k);
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);
end;
begin
readln(N,C1,C2);
N1:=1; N2:=1;
Euclide_Bezout(C1,C2,N,MCD,N1,N2);
writeln(MCD);
writeln(N1,' ',N2);
end.
cHJvZ3JhbSBnaWZ0Y2FyZDsKdmFyIE4sQzEsQzIsTjEsTjIsTUNEOmludDY0OyAKcHJvY2VkdXJlIEV1Y2xpZGVfQmV6b3V0IChhLCBiLCBjOmludDY0O3ZhciAgTUNEOmludDY0OyB2YXIgaDppbnQ2NDsgdmFyIGs6aW50NjQpOwp2YXIgeCxhcHA6aW50NjQ7CmJlZ2luIAogIGlmIGE8YiB0aGVuIGJlZ2luIGFwcDo9YTsgYTo9YjsgYjo9YXBwOyBlbmQ7CiAgaWYgYj0wIHRoZW4gCiAgICAgICAgICAgYmVnaW4KICAgICAgICAgICAgIGlmIGMgbW9kIGE9MCB0aGVuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVnaW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1DRDo9YTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGs6PWMgZGl2IGE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoOj0xOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhpdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZDsKICAgICAgICAgICAgZW5kOwogRXVjbGlkZV9CZXpvdXQoYixhIG1vZCBiLGMsTUNELGgsayk7CiAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaDo9aC1rKihhIGRpdiBiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4Oj0oaC0xKSBkaXYgKGEgZGl2IE1DRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgazo9ayt4KihiIGRpdiBNQ0QpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGg6PWgteCogKGEgZGl2IE1DRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogIAplbmQ7ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgCmJlZ2luCglyZWFkbG4oTixDMSxDMik7CglOMTo9MTsgTjI6PTE7CglFdWNsaWRlX0Jlem91dChDMSxDMixOLE1DRCxOMSxOMik7Cgl3cml0ZWxuKE1DRCk7Cgl3cml0ZWxuKE4xLCcgJyxOMik7CmVuZC4K