#include<iostream>
using namespace std;
int exgcd(int a,int b,int &x,int &y)//求最大公约数
{
if(b == 0)
{
x = 1;
y = 0;
return a;
}
int r = exgcd(b,a%b,x,y);
int t = x;
x = y;
y = t - a/b*y;
return r;
}
int main()
{
int a,b,m,n,r;
while(cin>>a>>b)
{
int i;
r = exgcd(a,b,m,n);
if(r == 1)
{
while(m < 0)
{
m += b;
n -= a;
}
printf("%d %d\n",m,n);
}
else
cout<<"sorry"<<endl;
}
return 0;
}