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