#include<iostream>
#include<cmath>

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