#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include <iostream>
#include<queue>
using namespace std;
int x,y;
int gcd(int m,int n)
{
if(m==0)
{
x=0;
y=1;
return n;
}
else
{
int tmp=gcd(n%m,m);
int p1=y-n/m*x;
int p2=x;
x=p1;
y=p2;
return tmp;
}
}
int main()
{
int a,b;
while(cin>>a>>b)
{
if(gcd(a,b)!=1)
cout<<"sorry"<<endl;
else
{
while(x<0)
{
x+=b;
y-=a;
}
while(x-b>=0)
{
x-=b;
y+=a;
}
cout<<x<<" "<<y<<endl;
}
}
return 0;
}