# filetran.py
# Written by Todd Wareham for CS 2500
"""
Given the name of a 4-column file of integers and a scaling factor x,
 print the 3-column version of this file consisting of the 4th column, the 
 3rd column multiplied by x, and the 2nd column.
"""

import sys

if len(sys.argv) != 3:
    print "usage: python", sys.argv[0], "filename factor"
    sys.exit(1)

for line in open(sys.argv[1]):
    c1, c2, c3, c4 = line.split()
    print c4, int(c3) * int(sys.argv[2]), c2
