#!/bin/python3 import sys hack="hackerrank" q = int(input().strip()) for a0 in range(q): s = input().strip() j=0 for i in s: #print(i,hack[j]) if hack[j]==i: j+=1 if j==(len(hack)): print("YES") break else: print("NO")