(define(vr v k)(vector-ref v k))
(define(vs v k a)(vector-set! v k a))
(define(mv n a)(make-vector n a))
(define(vvr v y x X)(vector-ref v(+(* y X)x)))
(define(vvs v y x X a)(vector-set! v(+(* y X)x)a))

(define n(read))
(define a(mv n 0))
(define b(mv n 0))
(define i 0)
(while(< i n)
	(vs a i(read))
	(vs b i(read))
	(inc! i)
)
(define m(read))
(define c 0)
(define d 0)
(define j 0)
(define mind 0)
(define mand 0)
(define ans 0)
(while(< j m)
	(set! c(read))
	(set! d(read))
	(set! i 0)
	(set! mind 1145141919810)
	(set! ans 0)
	(while(< i n)
		(set! mand(+(abs(-(vr a i)c))(abs(-(vr b i)d))))
		(when(< mand mind)(begin(set! ans(+ i 1))(set! mind mand)))
		(inc! i)
	)
	(print ans)
	(inc! j)
)