def ordre_lex(mot1, mot2):
    if mot1 == "":
        return True
    if mot2 == "":
        return False

    i = 0
    while i < len(mot1) and i < len(mot2):
        c1 = mot1[i]
        c2 = mot2[i]
        if c1 < c2:
            return True
        elif c1 > c2:
            return False
        else:
            i = i + 1

    return len(mot1) <= len(mot2)