def getCommonPrefix(aLabel, bLabel):

    nn = 0
    while (aLabel[nn].lower() == bLabel[nn].lower()):
        nn += 1
        if (nn >= len(aLabel)):
            return (aLabel[:nn])
        if (nn >= len(bLabel)):
            return (aLabel[:nn])

    return (aLabel[:nn])