##################################
#                                #
# Last modified 2018/02/13       # 
#                                #
# Georgi Marinov                 #
#                                # 
##################################

import sys
import string
import os

def run():

    if len(sys.argv) < 1:
        print 'usage: python %s input' % sys.argv[0]
        sys.exit(1)

    input = sys.argv[1]

    if input.endswith('.bz2'):
        cmd = 'bzip2 -cd ' + input
    elif input.endswith('.gz'):
        cmd = 'zcat ' + input
    else:
        cmd = 'cat ' + input
    p = os.popen(cmd, "r")
    line = 'line'
    while line != '':
        line = p.readline()
        if line == '':
            break
        print line.strip().replace('\t',',')

run()

