#include <iostream>
using namespace std;int main(){    
int x,y,h1,h2,k1,k2,a,b,c,d;    
cin>>h1>>h2>>k1>>k2>>a>>b>>c>>d;    
x=(a*h1)+(b*h2)+(h1/10*c)+(h2/20*d);    
y=(a*k1)+(b*k2)+(k1/10*c)+(k2/20*d);    
if (x==y){    
    cout<<"even"<<endl;
    }else if (x>y){
        cout<<"hiroshi"<<endl;
    }else {
        cout<<"kenjiro"<<endl;
    }
}
