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