#include <bits/stdc++.h>
using namespace std;

int main() {
    int h1, h2, k1, k2;
    int a, b, c, d;
    int hsum=0, ksum=0;
    cin >> h1 >> h2 >> k1 >> k2;
    cin >> a >> b >> c >> d;
    hsum = h1*a+h1/10*c+h2*b+h2/20*d;
    ksum = k1*a+k1/10*c+k2*b+k2/20*d;
    if(hsum > ksum){
        cout << "hiroshi" << endl;
    }
    else if(hsum < ksum){
        cout << "kenjiro" << endl;
    }
    else{
        cout << "even" << endl;
    }
    return 0;
}
