'The  ordering  of  associative  words is defined by length and
lexicography (this ordering is called short-lex ordering), that
is, shorter words are smaller than longer words, and words of the
same length are compared w.r.t. the lexicographical ordering induced
by the ordering of generators. Generators  are  sorted  according
to the order in which they were created. If the generators are
invertible then each generator `g` is larger than its inverse `g^{-1}`,
and `g^{-1}` is larger than every generator that is smaller than `g`.
Examples
>>> from sympy.combinatorics.free_groups import free_group
>>> f, a, b = free_group("a b")
>>> b < a
False
>>> a < a.inverse()
False'

def __lt__(self, other):

    group = self.group
    if (not isinstance(other, group.dtype)):
        raise TypeError('only    FreeGroup    elements    of    same    FreeGroup    can    be    compared')
    l = len(self)
    m = len(other)
    if (l < m):
        return True
    elif (l > m):
        return False
    for i in range(l):
        a = self[i].array_form[0]
        b = other[i].array_form[0]
        p = group.symbols.index(a[0])
        q = group.symbols.index(b[0])
        if (p < q):
            return True
        elif (p > q):
            return False
        elif (a[1] < b[1]):
            return True
        elif (a[1] > b[1]):
            return False
    return False
