Buggy python submission (verdict: Time Limit Exceeded):
def uauau():
    N = int(input())
    aA=sorted(set(int(_) for _ in input().split()))
    N = len(aA)
    def ggg(i,j):
        i %= j
        if i == 0:
            return j
        else:
            return ggg(j,i)

    if len(aA) == 1:
        print(aA[0])
    else:
        iMin = aA[0]
        iMax = aA[-1]
        if iMin  == 1:
            print(1)
        else:
            iMt = max(i % iMin for i in aA)
            if iMt == 0:
                print(iMin)
                exit()
            elif iMt  == 1:
                print (1)
            else:
                iM = iMax
                for i in range(N):
                    iA = aA[i]
                    for j in range(i+1,N):
                        if aA[j] % iA != 0:
                            iMt = ggg(aA[j],iA)
                            if iMt < iM:
                                iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
                print(iM)
uauau()


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
def uauau():
    N = int(input())
    aA=sorted(set(int(_) for _ in input().split()))
    N = len(aA)
    def ggg(i,j):
        i %= j
        if i == 0:
            return j
        else:
            return ggg(j,i)

    if len(aA) == 1:
        print(aA[0])
    else:
        iMin = aA[0]
        iMax = aA[-1]
        if iMin  == 1:
            print(1)
        else:
            iMt = max(i % iMin for i in aA)
            if iMt == 0:
                print(iMin)
                exit()
            elif iMt  == 1:
                print (1)
            else:
                iM = iMax
                for i in range(N):
                    iA = aA[i]
                    for j in range(i+1,N):
                        iMt = ggg(aA[j],iA)
                        if iMt < iM:
                            iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
                print(iM)
uauau()


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
def uauau():
    N = int(input())
    aA=sorted(set(int(_) for _ in input().split()))
    N = len(aA)
    def ggg(i,j):
        i %= j
        if i == 0:
            return j
        else:
            return ggg(j,i)

    if len(aA) == 1:
        print(aA[0])
    else:
        iMin = aA[0]
        iMax = aA[-1]
        if iMin  == 1:
            print(1)
        else:
            iMt = max(i % iMin for i in aA)
            if iMt == 0:
                print(iMin)
                exit()
            elif iMt  == 1:
                print (1)
            else:
                iM = iMax
                for i in range(N):
                    iA = aA[i]
                    for j in range(i+1,N):
                        iMt = ggg(aA[j],iA)
                        if 0 < iMt and iMt < iM:
                            iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
                print(iM)
uauau()


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
def uauau():
    N = int(input())
    aA=sorted(set(int(_) for _ in input().split()))
    N = len(aA)
    def ggg(i,j):
        i %= j
        if i == 0:
            return j
        else:
            return ggg(j,i)

    if len(aA) == 1:
        print(aA[0])
    else:
        iMin = aA[0]
        iMax = aA[-1]
        if iMin  == 1:
            print(1)
        else:
            if False:
                pass
            #if max(i % iMin for i in aA) == 0:
            #   print(iMin)
            #   exit()
            else:
                iM = iMax
                for i in range(N):
                    iA = aA[i]
                    for j in range(i+1,N):
                        iMt = ggg(aA[j],iA)
                        if 0 < iMt and iMt < iM:
                            iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
                print(iM)
uauau()


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
aA=sorted(set(int(_) for _ in input().split()))
N = len(aA)
def ggg(i,j):
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if len(aA) == 1:
    print(aA[0])
else:
    iMin = aA[0]
    iMax = aA[-1]
    if iMin  == 1:
        print(1)
    else:
        if max(i % iMin for i in aA) == 0:
            print(iMin)
            exit()
        else:
            iM = iMax
            for i in range(N):
                iA = aA[i]
                for j in range(i+1,N):
                    iMt = ggg(aA[j],iA)
                    if 0 < iMt and iMt < iM:
                        iM = iMt
                if iM == 1:
                    print(1)
                    exit()
            print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
aA=sorted(set(int(_) for _ in input().split()))
N = len(aA)
def ggg(i,j):
    if i < j :
        i,j = j,i
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if len(aA) == 1:
    print(aA[0])
else:
    iMin = aA[0]
    iMax = aA[-1]
    if iMin  == 1:
        print(1)
    else:
        if max(i % iMin for i in aA) == 0:
            print(iMin)
            exit()
        else:
            iM = iMax
            for i in range(N):
                iA = aA[i]
                for j in range(i+1,N):
                    iMt = ggg(iA,aA[j])
                    if 0 < iMt and iMt < iM:
                        iM = iMt
                if iM == 1:
                    print(1)
                    exit()
            print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
aA=list(set(int(_) for _ in input().split()))
N = len(aA)
def ggg(i,j):
    if i < j :
        i,j = j,i
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if len(aA) == 1:
    print(aA[0])
else:
    iMin = min(aA)
    iMax = max(aA)
    if iMin  == 1:
        print(1)
    else:
        if max(i % iMin for i in aA) == 0:
            print(iMin)
            exit()
        else:
            iM = iMax
            for i in range(N):
                iA = aA[i]
                for j in range(i+1,N):
                    iMt = ggg(iA,aA[j])
                    if 0 < iMt and iMt < iM:
                        iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
            print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
aA=list(set(int(_) for _ in input().split()))
N = len(aA)
def ggg(i,j):
    if i < j :
        i,j = j,i
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if len(aA) == 1:
    print(aA[0])
else:
    iMin = min(aA)
    iMax = max(aA)
    if iMin  == 1:
        print(1)
    else:
        iDm = [i % iMin for i in aA]
        if max(iDm) == 0:
            print(iMin)
            exit()
        else:
            iM = iMax
            for i in range(N):
                iA = aA[i]
                for j in range(i+1,N):
                    iMt = ggg(iA,aA[j])
                    if 0 < iMt and iMt < iM:
                        iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
            print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
aA=list(set(int(_) for _ in input().split()))
def ggg(i,j):
    if i < j :
        i,j = j,i
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if len(aA) == 1:
    print(aA[0])
else:
    iMin = min(aA)
    iMax = max(aA)
    if iMin  == 1:
        print(1)
    else:
        iDm = [i % iMin for i in aA]
        if max(iDm) == 0:
            print(iMin)
            exit()
        else:
            iM = iMax
            for i in range(N):
                iA = aA[i]
                for j in range(i+1,N):
                    iMt = ggg(iA,aA[j])
                    if 0 < iMt and iMt < iM:
                        iM = iMt
                    if iM == 1:
                        print(1)
                        exit()
            print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
aA=[int(_) for _ in input().split()]
iMin = min(aA)
iMax = max(aA)


def ggg(i,j):
    if i < j :
        i,j = j,i
    i %= j
    if i == 0:
        return j
    else:
        return ggg(j,i)

if iMin  == 1:
    print(1)
else:
    iDm = [i % iMin for i in aA]
    if max(iDm) == 0:
        print(iMin)
        exit()
    else:
        iM = iMax
        for i in range(N):
            iA = aA[i]
            for j in range(i+1,N):
                iMt = ggg(iA,aA[j])
                if 0 < iMt and iMt < iM:
                    iM = iMt
                if iM == 1:
                    print(1)
                    exit()
        print(iM)


Fixed submission:
#gcdか....
def fgcd(a,b):
    while b:
        a,b = b,a%b
    return a

N = int(input())
aA = sorted(set(int(_) for _ in input().split()))
b = aA[0]
for a in aA[1:]:
    b = fgcd(a,b)
print(b)