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