# Isn't it because the problem is asking you to solve 183x == 15 (mod 31)? so you're looking for x such that this is true from the start