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