#include <bits/stdc++.h>
#define fo(i,a) for(i = 0;i < a;i++)
using namespace std;
int main(void)
{
	int n,i,y,i2,y2;
	int a,b,c,d,h=0,k=0;
	
	cin >> i >> y;
	cin >> i2 >> y2;
	cin >> a >> b >> c >> d ;
	h += (i/10)*c + (y/20)*d + i*a + y*b;
	k += (i2/10)*c + (y2/20)*d + i2*a + y2*b;
	if(h < k) cout << "kenjiro" << endl;
	else if(h == k) cout << "even" << endl;
	else  cout << "hiroshi" << endl;
	
	return 0 ;
}

