#!/usr/bin/env python

from seqlib import read_sequences, write_sequence

def max_ostretch_len(doc):
    result = 0
    current = 0
    for line in doc:
        code, tag = line.split()
        if tag == 'O':
            current += 1
            if current > result:
                result = current
        else:
            current = 0
    return result

for doc in read_sequences():
    if max_ostretch_len(doc) < 4:
        write_sequence(doc)
