def common_prefix(a, b):
    for (i, (a_i, b_i)) in enumerate(zip(a, b)):
        if (a_i != b_i):
            return a[:i]
    return a[:max(len(a), len(b))]
def common_prefix(a, b):
    for (i, (a_i, b_i)) in enumerate(zip(a, b)):
        if (a_i != b_i):
            return a[:i]
    return a[:max(len(a), len(b))]