Why am I getting EQMNG (Eventually Equal) Wrong?

cook your dish here

import math
t = int(input())
for _ in range(t):
A, B, C = map(int, input().split())
x = 0
if A != B:
while math.gcd(A, C) != math.gcd(B, C):
C += 1
x += 1
print(x + 1)
else:
print(0)

Please help me with this problem.

Don’t say indents, i did add them.

You’re missing the idea of applying GCD twice, before and after incrementing C. GCD(K, K+1) = 1 no matter the value of K, so GCD(A, C, C+1) = GCD(B, C, C+1) = 1