#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): a = raw_input().strip() # your code goes here b = 'hackerrank' temp = '' for i in b: n = 0 for j in a: n = n + 1 if i == j: a = a[n:] temp = temp + i break if temp == b: print 'YES' else: print 'NO'