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

int main(){
  int h1, h2, k1, k2;
  int a, b, c, d;
  int p1, p2;

  cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >>d;

  p1 = h1 * a + h2 * b + (h1 / 10) * c + (h2 / 20) * d;
  p2 = k1 * a + k2 * b + (k1 / 10) * c + (k2 / 20) * d;

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

  return 0;
}

