#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() copy=s # your code goes here match='hackerrank' i=0 flag=True while(len(copy)>0): if match[i] in copy: ind = copy.index(match[i]) copy=copy[ind+1:] else: print('NO') flag=False break i+=1 if i>=len(match): print('YES') flag=False break if flag==True: print('NO')