#!/bin/python import sys keyword = "hackerrank" q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here for let in keyword: if let not in s: break count = 0 keycount = 0 while count < len(s) and keycount != 10: if s[count] == keyword[keycount]: count += 1 keycount += 1 else: count += 1 if keycount == 10: print "YES" else: print "NO"