#!/usr/bin/env python3
import sys
html = sys.stdin.buffer.read().decode('utf-8', errors='replace')

t = html[html.find('<title>'):html.find('</title>')+8] if '<title>' in html else ''
print("TITLE:", t)

idx = html.find('con-main')
if idx > 0:
    start = max(0, idx - 30)
    print("\n=== con-main region ===")
    print(html[start:start+2000])

idx2 = html.find('main-txt')
if idx2 > 0:
    start2 = max(0, idx2 - 100)
    print("\n=== main-txt region ===")
    print(html[start2:start2+1500])

idx3 = html.find('small-title')
if idx3 > 0:
    after = html[idx3:]
    end_div = after.find('</div>')
    if end_div > 0:
        print("\n=== After small-title ===")
        print(after[:end_div+20])
        rest = after[end_div+20:]
        print("...continued:", rest[:1500])
