#include <iostream>
using namespace std;
int main(void){
    int h,H;
    cin >>h>>H;
    int k,K;
    cin >>k>>K;
    int a,b,c,d;
    cin >>a>>b>>c>>d;
    int A,B;
    A=h*a+H*b+h/10*c+H/20*d;
    B=k*a+K*b+k/10*c+K/20*d;
    if(A>B){
        cout <<"hiroshi"<<endl;
    }
    else if(A<B){
        cout <<"kenjiro"<<endl;
    }
    else if(A==B){
        cout <<"even"<<endl;
    }
}
