WA in GCD2

I am getting WA for this question
Here is my solution
Please tell me what is wrong in the program. Tried all the trivial cases including extreme values of A and B but I don’t get where my code fails.