#!/bin/python3 import sys o = "hackerrank" q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here i = 0 k = 0 while i < len(s): if o[k] == s[i]: k += 1 if k == len(o): break i += 1 if k == len(o) and i < len(s): print("YES") else: print("NO")