#include<iostream>
using namespace std;

int main(){
    int h1,h2,k1,k2,a,b,c,d;
    cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;

    int hiroshi,kenjiro;

    hiroshi=h1*a+(h1/10)*c+h2*b+(h2/20)*d;

    kenjiro=k1*a+(k1/10)*c+k2*b+(k2/20)*d;

    if(hiroshi<kenjiro){
        cout << "kenjiro" << endl;
    }

    else if(hiroshi>kenjiro){
        cout << "hiroshi" << endl;
    }

    else{
        cout << "even" << endl;
    }

    return 0;
}
