#!/usr/bin/env python
from sys import argv, exit

if len(argv) < 2:
    print 'Usage: python %s TASKS' % argv[0]
    exit()

files = range(int(argv[1]))
lines = [open('out%d.txt' % i).readlines() for i in files]
lines = [' '.join([lines[j][i][:-1] for j in files]) for i in
        range(len(lines[0]))]

print '\n'.join(lines)
