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