ex_gcd:
#include<stdio.h>
#include<string.h>
using namespace std;
int x,y;
int ex_gcd(int a,int b,int &x,int &y)
{
if(b==)
{
x=;
y=;
return a;
}
int ans=ex_gcd(b,a%b,x,y);
int tmp=x;
x=y;
y=tmp-a/b*y;
return ans;
}
int main()
{
int a,b;
while(~scanf("%d%d",&a,&b))
{
ex_gcd(a,b,x,y);
printf("%d %d\n",x,y);
}
}