#!/bin/python3 import sys q = int(input().strip()) hacker = list("hackerrank") for a0 in range(q): notIn = False s = input().strip() # your code goes here i = 0 l = 0 while l < len(hacker): #print(hacker[l]) #print(s.index(hacker[l])) try: i = s.index(hacker[l], i) + 1 l += 1 except ValueError: notIn = True break if notIn == True: print("NO") elif notIn == False: print("YES")