def compress_fastr(sequence):
    """Eliminates repeats in a sequence and returns a string"""
    compressed_sequence = []
    if type(sequence) == str:
        sequence = sequence.split('-')
    last_read = None
    read_repeats = 0
    for read in enumerate(sequence):
        if read[1] == last_read:
            read_repeats += 1
        else:
            if read_repeats != 0:
                compressed_sequence.append('{0}x{1}'.format(str(
                    read_repeats + 1), str(last_read)))
                read_repeats = 0
            elif read[0] != 0:
                compressed_sequence.append(str(last_read))
            last_read = read[1]
        if read[0] + 1 == len(sequence):
            if read_repeats != 0:
                compressed_sequence.append('{0}x{1}'.format(str(
                    read_repeats + 1), str(last_read)))
            else:
                compressed_sequence.append(str(last_read))
            compressed_sequence = '-'.join(compressed_sequence)
    return compressed_sequence
