#!/usr/bin/python
# author: "Baekdoo Kim (baegi7942@gmail.com)"
# ver. 0.0.1

import sys

data = open(sys.argv[1],'r')
fout = open(sys.argv[2],'w')
for line in iter(data.readline, b''):
	name = line.split('\t')[0]
	items = line.split('\t')[1]
	item_list = items.split(' ')
	for i in item_list:
		if ( i[len(i)-1] == ";" ):
			i = i[0:len(i)-1]
			fout.write('%s\t%s\n' % (name, i))
		else:
			fout.write('%s\t%s' % (name, i))

data.close()
fout.close()

