818_C. Sofa Thief
Yet another round on DecoForces is coming! Grandpa Maks wanted to participate in it but someone has stolen his precious sofa! And how can one perform well with such a major loss?

Fortunately, the thief had left a note for Grandpa Maks. This note got Maks to the sofa storehouse. Still he had no idea which sofa belongs to him as they all looked the same!

The storehouse is represented as matrix n × m. Every sofa takes two neighbouring by some side cells. No cell is covered by more than one sofa. There can be empty cells.

Sofa A is standing to the left of sofa B if there exist two such cells a and b that xa < xb, a is covered by A and b is covered by B. Sofa A is standing to the top of sofa B if there exist two such cells a and b that ya < yb, a is covered by A and b is covered by B. Right and bottom conditions are declared the same way. 

Note that in all conditions A ≠ B. Also some sofa A can be both to the top of another sofa B and to the bottom of it. The same is for left and right conditions.

The note also stated that there are cntl sofas to the left of Grandpa Maks's sofa, cntr — to the right, cntt — to the top and cntb — to the bottom.

Grandpa Maks asks you to help him to identify his sofa. It is guaranteed that there is no more than one sofa of given conditions.

Output the number of Grandpa Maks's sofa. If there is no such sofa that all the conditions are met for it then output -1.

Input

The first line contains one integer number d (1 ≤ d ≤ 105) — the number of sofas in the storehouse.

The second line contains two integer numbers n, m (1 ≤ n, m ≤ 105) — the size of the storehouse.

Next d lines contains four integer numbers x1, y1, x2, y2 (1 ≤ x1, x2 ≤ n, 1 ≤ y1, y2 ≤ m) — coordinates of the i-th sofa. It is guaranteed that cells (x1, y1) and (x2, y2) have common side, (x1, y1)  ≠  (x2, y2) and no cell is covered by more than one sofa.

The last line contains four integer numbers cntl, cntr, cntt, cntb (0 ≤ cntl, cntr, cntt, cntb ≤ d - 1).

Output

Print the number of the sofa for which all the conditions are met. Sofas are numbered 1 through d as given in input. If there is no such sofa then print -1.

Examples

Input

2
3 2
3 1 3 2
1 2 2 2
1 0 0 1


Output

1


Input

3
10 10
1 2 1 1
5 5 6 5
6 4 5 4
2 1 2 0


Output

2


Input

2
2 2
2 1 1 1
1 2 2 2
1 0 0 0


Output

-1

Note

Let's consider the second example. 

  * The first sofa has 0 to its left, 2 sofas to its right ((1, 1) is to the left of both (5, 5) and (5, 4)), 0 to its top and 2 to its bottom (both 2nd and 3rd sofas are below). 
  * The second sofa has cntl = 2, cntr = 1, cntt = 2 and cntb = 0. 
  * The third sofa has cntl = 2, cntr = 1, cntt = 1 and cntb = 1. 



So the second one corresponds to the given conditions.

In the third example 

  * The first sofa has cntl = 1, cntr = 1, cntt = 0 and cntb = 1. 
  * The second sofa has cntl = 1, cntr = 1, cntt = 1 and cntb = 0. 



And there is no sofa with the set (1, 0, 0, 0) so the answer is -1.
```python
import sys
from collections import defaultdict as dd
from collections import deque

pl=1
from math import *
import copy
#sys.setrecursionlimit(10**6)
if pl:
	input=sys.stdin.readline

def li():
	return [int(xxx) for xxx in input().split()]
def fi():
	return int(input())
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())	
 

d=[]		
from bisect import *		

from itertools import permutations 
from bisect import *
f=[0 for i in range(100)]

for i in range(1,100):
	if i==1:
		f[i]=1
	else:
		f[i]=2*f[i-1]+1

#print(f[:15])
def rec(n,k):
	s=[]
	while n!=0:
		n,r=n//k,n%k
		#print(n,r)
		if r<0:
			r-=k
			n+=1
		#print(s,n,r)	
		s.append(r)		
	return s		
n=fi()
p,q=mi()
pp=[]
l=[];r=[];u=[];d=[]
for i in range(n):
	x1,y1,x2,y2=mi()
	x1,x2=min(x1,x2),max(x1,x2)
	y1,y2=min(y1,y2),max(y1,y2)
	l.append(x1)
	r.append(-x2)
	u.append(y1)
	d.append(-y2)
	pp.append([x1,x2,y1,y2])
l.sort()
r.sort()
u.sort()
d.sort()
#print(l,r,u,d)
f=[[0,0,0,0] for i in range(n+1)]
for i in range(n):
	f[i][0]=bisect_left(l,pp[i][1])
	if pp[i][0]<pp[i][1]:
		f[i][0]-=1
	f[i][1]=bisect_left(r,-pp[i][0])	
	if pp[i][0]<pp[i][1]:
		f[i][1]-=1
	f[i][2]=bisect_left(u,pp[i][3])
	if pp[i][2]<pp[i][3]:
		f[i][2]-=1
	f[i][3]=bisect_left(d,-pp[i][2])	
	if pp[i][2]<pp[i][3]:
		f[i][3]-=1	
	#f[l[i][1]][0]=bisect_left(l,)
co=li()		
#print(f)			
for i in range(n):
	if 	co==f[i]:
		print(i+1)
		exit(0)
print(-1)	
```