#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here act = list('hackerrank') ans = '' i = 0 for j in s: if j == act[i]: ans += j i += 1 if i == 10: break if ans == 'hackerrank': print('YES') else: print('NO')