def gcd(a,b):
    if(b==0):
        return a
    else:
        return gcd(b,a%b)

t=int(input())
for i in range(t):
    a,b=map(int,input().split())
    ans=gcd(a,b)
    print(ans)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: