#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int h1, h2, k1, k2, a, b, c, d;
int p1, p2;

int main()
{
	in >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;
	p1 += a * h1 + c * (h1 / 10);
	p1 += b * h2 + d * (h2 / 20);
	p2 += a * k1 + c * (k1 / 10);
	p2 += b * k2 + d * (k2 / 20);
	if (p1 > p2) out << "hiroshi" << std::endl;
	else if (p1 < p2) out << "kenjiro" << std::endl;
	else out << "even" << std::endl;
	return 0;
}
