# We need to be careful when creating the test set as we rows
# from some plate ids.  We can't just just grep, as we need the header.
# So, we define a few plate id here and dump everything before a
# copy and below that only lines containing sentinel.

import sys


sentinels = ['54555', '41012', '42057']
copying = True


for ln in sys.stdin:
	if copying:
		sys.stdout.write(ln)
		if ln.startswith("COPY"):
			copying = False
	else:
		for s in sentinels:
			if s in ln:
				sys.stdout.write(ln)
				break
