#!/usr/bin/env python3

# coding: UTF-8

import sys

master_cxt = sys.argv[1]

with open(master_cxt) as f:
    master = f.readlines()
    
startline = 5
stopline = int(master[3])+int(master[2])+5

for change_cxt in sys.argv[2:]:
	with open(change_cxt) as f:
		change = f.readlines()
	change = (change[:startline] +
	          master[startline:stopline] + 
	          change[stopline:])
	with open(change_cxt,'w') as f:
		f.write("".join(change))

