#include<iostream>
using namespace std;

int main(){
    int h[2];
    int k[2];
    cin>>h[0]>>h[1];
    cin>>k[0]>>k[1];
    int a,b,c,d;
    cin>>a>>b>>c>>d;

    int hp=a*h[0]+(h[0]/10)*c+b*h[1]+(h[1]/20)*d;
    int kp=a*k[0]+(k[0]/10)*c+b*k[1]+(k[1]/20)*d;

    if(hp>kp) cout<<"hiroshi"<<endl;
    else if(hp<kp) cout<<"kenjiro"<<endl;
    else cout<<"even"<<endl;

    return 0;
}
