def commonprefix(l):
    """Return the common prefix of a list of strings."""
    if not l:
        return ''
    prefix = l[0]
    for s in l[1:]:
        for i, c in enumerate(prefix):
            if c != s[i]:
                prefix = s[:i]
                break
    return prefix