#!/usr/bin/env python

"""
Input format: one document per line, the first tab-separated column contains
the ID, in the body, newlines are represented as <NEWLINE>.

Output: the same, but with documents with >= 10,000 bytes removed.
"""

import sys

for line in sys.stdin:
    docid, text = line.split('\t', 1)
    if len(text.rstrip().replace('<NEWLINE>', '\n')) < 10000:
        sys.stdout.write('%s\t%s' % (docid, text))
