#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  int H,h,K,k,a,b,c,d,r=0,m=0,i=0,j=0;
  cin >> H >> h;
  cin >> K >>k;
  cin >> a >> b >> c >> d;
  if(H>=10){
    r=H/10;
    r=r*c;
  }
  if(h>=20){
    m=h/20;
    m=m*d;
  }
  H=H*a+h*b+r+m;
  if(K>=10){
    i=K/10;
    i=i*c;
  }
  if(k>=20){
    j=k/20;
    j=j*d;
  }
  K=K*a+k*b+i+j;
  if(H>K){
    cout << "hiroshi" <<endl;
  }else if(K>H){
    cout << "kenjiro" <<endl;
  }else if(K==H){
    cout << "even" <<endl;
  }
  return(0);
}

