#!/bin/python import sys def test(s): l = [i for i in 'hackerrank'] for i in s: if len(l) == 0: return True if i == l[0]: l.pop(0) if len(l) == 0: return True else: return False q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() #print s if(test(s.lower())): print "YES" else: print "NO" # your code goes here