#include <iostream>

using namespace std;

int main()
{
	int h1, h2, k1, k2, a, b, c, d, hp, kp;

	cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;

	hp = (h1 / 10) * c + h1 * a + (h2 / 20) * d + h2 * b;
	kp = (k1 / 10) * c + k1 * a + (k2 / 20) * d + k2 * b;

	if (hp == kp)
	{
		cout << "even" << endl;
	}
	else
	{
		if (hp > kp)
		{
			cout << "hiroshi" << endl;
		}
		else
		{
			cout << "kenjiro" << endl;
		}
	}

    return 0;
}
