#Created on June 24, 2011
#Extract subset of nodes from resources file.

import sys

fIn = 'resources_3_24_1.txt'
fOut = 'resources.txt'

n = int(sys.argv[1])
fdIn = open(fIn, 'r')
fdOut = open(fOut, 'w')

first_line = False
for line in fdIn:
    if first_line == False: #Copy first line as it is
        first_line = True
        fdOut.write(line)
        continue
    tmp = line.split()
    if int(tmp[0]) < n: fdOut.write(line)

fdIn.close()
fdOut.close()
