#!/bin/python import sys hr = "hackerrank" q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() pos = 0 found = False for seek in s: if hr[pos] == seek: pos += 1 if pos >= len(hr): found = True break if found: print 'YES' else: print 'NO'