def enumerate_bases(bases):
    """
    Convert the given tuple of multiple sequence alignment bases (any
    characters) into a tuple of integers such that all rows with the same base
    share the same integer based on the order each base was seen.

    >>> enumerate_bases(("A", "A", "C", "C"))
    (0, 0, 1, 1)
    >>> enumerate_bases(("C", "C", "A", "A"))
    (0, 0, 1, 1)
    >>> enumerate_bases(("C", "-", "T", "C"))
    (0, 1, 2, 0)
    >>> enumerate_bases(("A", "C", "T", "G"))
    (0, 1, 2, 3)
    >>> enumerate_bases(("A", "A", "A", "A"))
    (0, 0, 0, 0)
    """
    current_index = 0
    base_to_index = {}
    integers = []
    for base in bases:
        if base not in base_to_index:
            base_to_index[base] = current_index
            current_index += 1

        integers.append(base_to_index[base])

    return tuple(integers)