'''
Created on Jan 5, 2012

@author: Dilum Bandara
'''
fIn = 'queries_rnd_11.txt'
fOut = 'queries_rnd_11_part.txt'

fdIn = open(fIn, 'r')
fdOut = open(fOut, 'w')

for line in fdIn:
    tmp = line.split()
    time = int(tmp[3])
    if (time >= 300 and time <= 1020) or (time >= 2100 and time <= 2820) or \
        (time >= 3900 and time <= 4620) or (time >= 5700 and time <= 6420) or \
        (time >= 7500 and time <= 8220) or (time >= 9300 and time <= 10020) or \
        (time >= 11100 and time <= 11820) or (time >= 12900 and time <= 13620):
        fdOut.write(line)
    
fdIn.close()
fdOut.close()