I'm trying to find the multiplicative inverse of $10$ modulo $27$ using the extended euclidean algorithm and Bezout's Identity. Using euclids algorithm I find that gcd$(27,10)=1$, and the extended version gives me $$1=\text{gcd}(27,10)=27\cdot 3+10\cdot(-8)$$ Since the multiplicative inverse has to be positive (in the set $\{0,\ldots ,26\}$), i can't use $-8$. How do I find a positive integer $x$ such that the above equation holds when replacing $-8$ with $x$? I've read a couple of posts here regarding this problem, but they seem a bit confusing.
Answers are greatly appreciated!