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