#include<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,a,b,c,d,x,y,n,m;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&y1,&y2,&a,&b,&c,&d);
	x=x1*a+x2*b;
	y=y1*a+y2*b;
	if(x1>=10){
		x3=x1/10;
		x=x+x3*c;
	}
	if(x2>=20){
		x4=x2/20;
		x=x+x4*d;
	}
	if(y1>=10){
		y3=y1/10;
		y=y+y3*c;
	}
	if(y2>=20){
		y4=y2/20;
		y=y+y4*d;
	}
	if(x>y){
		printf("hiroshi\n");
	}
	else if(x<y){
		printf("kenjiro\n");
	}
	else if(x==y){
		printf("even\n");
	}
	return 0;
}
