#include<iostream>
using namespace std;

int main(void){
	int h1, h2, k1, k2, a, b, c, d, resh, resk;
	cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;

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

	if(resh > resk) cout << "hiroshi";
	else if(resh < resk) cout << "kenjiro";
	else cout << "even";
	cout << endl;
}
