node extend_gcd(LL a,LL b){
node ans;
if(a%b==0){
ans.x=0,ans.y=1;
return ans;
}
ans=extend_gcd(b,a%b);
LL x=ans.y;
LL y=ans.x-(a/b)*ans.y;
ans.x=x;
ans.y=y;
return ans;
}
node extend_gcd(LL a,LL b){
node ans;
if(a%b==0){
ans.x=0,ans.y=1;
return ans;
}
ans=extend_gcd(b,a%b);
LL x=ans.y;
LL y=ans.x-(a/b)*ans.y;
ans.x=x;
ans.y=y;
return ans;
}