<gh_stars>1-10
import sys

d = {}
for line in sys.stdin:
    ts = line.split('\t')
    d[len(ts)] = line

for t in d:
    print t, d[t]

import sys

d = {}
for line in sys.stdin:
    ts = line.split('\t')
    d[len(ts)] = line

for t in d:
    print t, d[t]