#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here search_index = 0 index = 0 hackerrank = "hackerrank" contains = True while index < len(hackerrank): search_index = s.find(hackerrank[index]) if search_index is -1: contains = False break s = s[search_index+1:] index += 1 if contains: print("YES") else: print("NO")