<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def abbreviate(labels, rfill=' '):
 """ Abbreviate labels without introducing ambiguities. """

    max_len = max(len(l) for l in labels)
    for i in range(1, max_len):
        abbrev = [l[:i].ljust(i, rfill) for l in labels]
        if len(abbrev) == len(set(abbrev)):
            break
    return abbrev