Arjit, Protector of The Realm, has an important task at hand. M new subjects are soon going to become a part of The Realm. The Realm, though, already has N subjects who are well skilled in the ways of The Realm. He wants the new subjects too to become perfect in the ways. 

As any Protector would, Arjit also decides that the existing subjects should train the new subjects in the ways. What's so special about this situation though? Each current subject of The Realm has a special skill Sc  and he has reached a level of proficiency Pc   at this. Every new subject of The Realm feels his favorite skill he would like to have is ** Sn** and reach a proficiency ** Pn** at it.  

Let's call a current subject Foo and a new subject Bar. Foo can train Bar if Foo's special skill is the same one that Bar feels is his favorite. This is what we call a good pair. If Foo's special skill and Bar's favorite skill are the same and also Foo's proficiency is the same that Bar wants to achieve, we call it a great combination.  

Let A be the number of good pairs and B be the number of great combinations. Arjit would like to maximize the number of new subjects to be trained by current subjects, i.e., number of good pairs. And, after maximizing number the number of good pairs, he wishes to maximize the number of great combinations.  

Arjit wishes to have at least G good pairs and at least H great combinations.
If only the good pairs criteria is met, print "Good" (without quotes).
If both criterion are met, print "Great" (without quotes).
Else, print ":(" (without quotes).

Input:
The first line of input contains T. T test cases follow.
The first line of each test case has two integers, M and N.
In the following M lines, there are two integers on each line, U and V denoting favorite skill and proficiency they wish to obtain.
In the N lines that follow, there are two integers on each line, W and X denoting the special skill and the level of proficiency that has been reached.
The last line of each test case has two integers, G and H.

Output:
Print "Good", "Great" or ":(" (without quotes) on a new line for each test case.

Constraints:
1 ≤ T ≤ 10
1 ≤ M, N ≤ 10 ^5
1 ≤ U, V, W, X ≤ 10^4
1 ≤ G, H ≤ 10^5

See the example to understand better.

SAMPLE INPUT
1
2 2
1 1
2 3
1 1
2 3
2 2

SAMPLE OUTPUT
Great

Explanation

You have 2 new subjects and 2 current members of the realm.
Each new member is perfectly matched with an existing member of the realm.
So, good pair count is 2 and great combination count is also 2.
So, the output is "Great" (without quotes).
T = int(raw_input())
for _ in xrange(T):
	M, N = map(int,raw_input().split())
	A = [0]*M
	B = [0]*N
	for i in xrange(M):
		u,v = map(int,raw_input().split())
		A[i] = (u,v)
	for i in xrange(N):
		w,x = map(int,raw_input().split())
		B[i] = (w,x)
	g,h = map(int,raw_input().split())
	aa = a1 = dict()
	bb = b1 = dict()
	for i in A:
		x=i[0]
		y=i[1]
		if x not in a1:
			a1[x] = 1
		else:
			a1[x] += 1
		if i not in aa:
			aa[i] = 1
		else:
			aa[i] += 1
	for i in B:
		x=i[0]
		y=i[1]
		if x not in b1:
			b1[x] = 1
		else:
			b1[x] += 1
		if i not in bb:
			bb[i] = 1
		else:
			bb[i] += 1
	
	gg = hh = 0
	for x in a1:
		if x in b1:
			gg += min(a1[x],b1[x])
	for i in aa:
		if i in bb:
			hh += min(aa[i],bb[i])
		
	if gg >= g:
		if hh >= h:
			print "Great"
		else:
			print "Good"
	else:
		print ":("