Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
c = []
for i in range(a):
    x = i + 1
    if a%x == 0:
        if b%x == 0:
            c.append(x)
print(c[-1])



Fixed submission:
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
if b%a == 0:
    print(a)
else:
    while True:
        for i in range(a):
            x = i + 2
            if a%x == 0:
                if b%x == 0:
                    c.append(x)
                    a = a//x
                    b = b//x
                    break
                elif b%(a//x) == 0:
                    c.append(a//x)
                    a = x
                    b = b//(a//x)
                    break
            if x > a**0.5:
                break
        if x > a**0.5:
            break
    s = 1
    for j in c:
        s = s * j
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
c = []
while True:
    for i in range(a):
        x = i + 2
        if a%x == 0:
            if b%x == 0:
                c.append(x)
                a = int(a/x)
                b = int(b/x)
                break
    if i == a-1:
        break
s = 1
for j in c:
    s = s * j
print(s)



Fixed submission:
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
if b%a == 0:
    print(a)
else:
    while True:
        for i in range(a):
            x = i + 2
            if a%x == 0:
                if b%x == 0:
                    c.append(x)
                    a = a//x
                    b = b//x
                    break
                elif b%(a//x) == 0:
                    c.append(a//x)
                    a = x
                    b = b//(a//x)
                    break
            if x > a**0.5:
                break
        if x > a**0.5:
            break
    s = 1
    for j in c:
        s = s * j
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
while True:
    for i in range(a):
        x = i + 2
        if a%x == 0:
            if b%x == 0:
                c.append(x)
                a = a//x
                b = b//x
                break
    if i == a-1:
        break
s = 1
for j in c:
    s = s * j
print(s)



Fixed submission:
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
if b%a == 0:
    print(a)
else:
    while True:
        for i in range(a):
            x = i + 2
            if a%x == 0:
                if b%x == 0:
                    c.append(x)
                    a = a//x
                    b = b//x
                    break
                elif b%(a//x) == 0:
                    c.append(a//x)
                    a = x
                    b = b//(a//x)
                    break
            if x > a**0.5:
                break
        if x > a**0.5:
            break
    s = 1
    for j in c:
        s = s * j
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
while True:
    for i in range(a):
        #print(a, i)
        x = i + 2
        if a%x == 0:
            if b%x == 0:
                c.append(x)
                a = a//x
                b = b//x
                #print(c)
                break
    if i > a**0.5:
        break
s = 1
for j in c:
    s = s * j
print(s)



Fixed submission:
a, b = map(int, input().split())
c = []
if a > b:
    a, b = b, a
if b%a == 0:
    print(a)
else:
    while True:
        for i in range(a):
            x = i + 2
            if a%x == 0:
                if b%x == 0:
                    c.append(x)
                    a = a//x
                    b = b//x
                    break
                elif b%(a//x) == 0:
                    c.append(a//x)
                    a = x
                    b = b//(a//x)
                    break
            if x > a**0.5:
                break
        if x > a**0.5:
            break
    s = 1
    for j in c:
        s = s * j
    print(s)