#include<bits/stdc++.h>

using namespace std;

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

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

	score1 = h1 * a + h2 * b + h1 / 10 * c + h2 / 20 * d;
	score2 = k1 * a + k2 * b + k1 / 10 * c + k2 / 20 * d;

	if (score1 > score2) {
		cout << "hiroshi" << endl;
	}
	else if (score1 < score2) {
		cout << "kenjiro" << endl;
	}
	else {
		cout << "even" << endl;
	}

	return 0;
}

