#include<stdio.h> #include<iostream> #define ll __int64 ll gcd(ll a,ll b,ll &x,ll &y) { ll k; if(b==0) { x=1;y=0; return a; } ll d=gcd(b,a%b,x,y); k=x; x=y; y=k-a/b*y; return d; } int main() { ll a,b,x,y,t,n; while(scanf("%I64d%I64d",&a,&b)!=EOF) { t=gcd(a,b,x,y); if(t!=1) printf("sorry "); else { while(x<0)x+=b,y-=a;//需要注意 printf("%I64d %I64d ",x,y); } } return 0;}