#include <iostream>
using namespace std;

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