#!/bin/python3
from sys import stdin
key = ""
value = []
pom = 1

#TODO Wywalić pierwszego if'a poza for'a jako pojedyńczy stdin > DONE
firstRow = stdin.readline()
key = firstRow.split('\t')[0]
value.append(firstRow.split('\t')[1].replace("\n", ""))

for i in stdin:
    if i.split('\t')[0] == key:
        value.append(i.split('\t')[1].replace("\n", ""))
    else:
        print(key,"\t",value)
        value = []
        key = i.split('\t')[0]
        value.append(i.split('\t')[1].replace("\n", ""))

print(key, "\t", value)
