#include <iostream>
using namespace std;
int main(void){
int i,o,l,p,s,k,a,b,c,d;
cin>>i>>o>>l>>p>>a>>b>>c>>d;
k=(i*a+o*b)+c*(i/10)+d*(o/20);
s=(l*a+p*b)+c*(l/10)+d*(p/20);
if(k<s){
    cout<<"kenjiro"<<endl;
}
if(k>s){
    cout<<"hiroshi"<<endl;
}
if(k==s){
    cout<<"even"<<endl;
}
}

