code: def abbreviate(labels, rfill=' '):
      
      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
docs: Abbreviate labels without introducing ambiguities.