#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

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

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

	int h = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d;
	int k = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d;

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

	return 0;
}
