#!/usr/bin/env python

import sys
import xml.dom.minidom

last = ""
sentences = []
art_id = 0
for line in sys.stdin.readlines():
    chunks = line[:-1].split("|")
    id = chunks[0]
    sentence = "".join(chunks[1:])
    source, article, paragraph, sent_id = id.rsplit("-", 3)
    art_par = "{0}-{1}".format(article, paragraph)
    if sent_id == "1":
        if last != "":
            sys.stdout.write("{0}\n".format(" <SENT>".join(sentences)))
        sentences = []
        last = art_par
    sentences.append(sentence)
sys.stdout.write("{0}\n".format(" <SENT> ".join(sentences)))    

