import sys

from itertools import zip_longest

def grouper(iterable, n, fillvalue=None):
        "Collect data into fixed-length chunks or blocks"
        # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
        args = [iter(iterable)] * n
        return zip_longest(*args, fillvalue=fillvalue)



m = 3
file = sys.stdin
output_file = sys.stdout
for words in grouper(file, m, fillvalue=''):
    print(*map(str.strip, words), file=output_file)