BIG GCD run error and wrong answer

question = https://hack.codingblocks.com/contests/c/452/702
solution = https://ide.codingblocks.com/#/s/20866

Hanle the case with a=0 as you are takig modulo of string expressions with a you will get runerror for a=0
https://ide.codingblocks.com/#/s/21089

https://ide.codingblocks.com/#/s/21126 this one shows wrong answer(when i output the string for a=0)
https://ide.codingblocks.com/#/s/21127 this one shows run error because i didn’t handled for modulo for a=0

I have modified ur code , you can heck this out, you mae some mistakes while calculating gcd
https://ide.codingblocks.com/#/s/21133