def common_head (list) :
    """Return common head of all strings in `list`.
       >>> common_head ([])
       ''
       >>> common_head (["a"])
       'a'
       >>> common_head (["a", "b"])
       ''
       >>> common_head (["ab", "ac", "b"])
       ''
       >>> common_head (["ab", "ac", "ab"])
       'a'
       >>> common_head (["abc", "abcde", "abcdxy"])
       'abc'
    """
    result = ""
    list   = sorted (list)
    if list :
        match = [(l == r and r) or "\0"
                for (l, r) in zip (list [0], list [-1])
                ]
        try :
            last = match.index ("\0")
        except ValueError :
            last = len (match)
        result = "".join (match [:last])
    return result