
def transforma(it):
    it2 = map(lambda s: s.replace('A', 'R').replace('E', 'S'), it)
    it3 = filter(lambda p: ('RRR' not in p) and ('SSS' not in p), it2)
    return it3
