h = gets.split.map &:to_i
k = gets.split.map &:to_i
a, b, c, d = gets.split.map &:to_i
H = h[0]*a + h[1]*b + h[0].div(10)*c + h[1].div(20)*d
K = k[0]*a + k[1]*b + k[0].div(10)*c + k[1].div(20)*d
puts "even" if H == K
puts "hiroshi" if H > K
puts "kenjiro" if H < K