#!/bin/python import sys hacker = 'hackerrank' # hacker = hacker.strip() def chek(str): j = 1 for i in hacker: try: str.index(i) j += 1 except ValueError: return "NO" return "YES" q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here ans = chek(s) print ans