def METHOD_NAME(orig: bytes, maxsz=20):
    avghd = calavghdall(orig, maxsz)
    gcd12 = math.gcd(avghd[0][0], avghd[1][0])
    gcd13 = math.gcd(avghd[0][0], avghd[2][0])
    gcd23 = math.gcd(avghd[1][0], avghd[2][0])
    if gcd12 != 1:
        if gcd12 == gcd13 and gcd12 == gcd23:
            if gcd12 in [t[0] for t in avghd[:5]]:
                if gcd12 == avghd[0][0] or gcd12 == avghd[0][1]:
                    return gcd12
    return avghd[0][0]