Two sweet dogs, Bernard and Havanese, play the following game.
There are P sticks, each of exactly Q meters in length. The dogs move in turns. For each move a dog chooses a stick and splits it into two or more equal parts each having integer length greater than or equal to S meters. Each resulting part is also a stick. The dog that can't make a move loses. Thus, the other dog wins.
Bernard makes the first move. Now you have to determine the winner if players play in the optimal way.

Input :
First line of Input contains number of test cases T. Each test case contains three integers P, Q and S.

Output :
For each test case print "Bernard", if Bernard wins, or "Havanese", if Havanese wins. You should print everything without the quotes.

Constraint: 
1 ≤ T ≤ 10
1 ≤ P,Q,S ≤ 10^9

SAMPLE INPUT
2
1 15 4
4 9 5

SAMPLE OUTPUT
Bernard
Havanese
def divisors(n):
	from math import sqrt
	s = int(sqrt(n + 0.0))
	for i in xrange(1, s + 1):
		if n % i == 0:
			yield i
			yield (n / i)

def winning(p, q, s):
	if p % 2 == 0:
		return False
	
	for d in divisors(q):
		if d >= 2 and q / d >= s and not winning(d, q / d, s):
			return True
			
	return False

def main():
	T = int(raw_input().strip())
	for t in xrange(T):
		p, q, s = map(int, raw_input().split())
		print "Bernard" if winning(p, q, s) else "Havanese"

main()