#!/usr/bin/env python2
import sys

with open(sys.argv[1]) as f:
    first = True
    for line in f.readlines():
        if first:
            first = False
            continue
        x0,y0, x1,y1, s,f = line.split(' ')
        d = abs(int(x1)-int(x0)) + abs(int(y1)-int(y0))
        t = abs(int(s)-int(f))
        if d>t:
            print line
