arthur2e5@tg says to YSITD
Extended Euclidean Algorithm!