#!/bin/python3 import sys z = "hackerrank" q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here #s = s.translate({ord(c): None for c in '!@#$bdfgijlmopqstuvwxzy'}) #s.index("h") #s = s.lower() nofound = 0 for c in z: try: ind = s.index(c) except: ind = -1 if (ind==-1): nofound=1 print("NO") break else: s = s[ind+1:] if (nofound==0): print("YES")