(:source lang=python:)
import re
if __name__ == "__main__":
data = open('input2', 'r').read() result = re.findall('[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]', data) print ''.join(result)
(:sourceend:)