#!/bin/python3 import sys searched_string = 'hackerrank' searched_length = len(searched_string) q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here pointer = 0 found = False for c in s: if pointer == searched_length: found = True break if c == searched_string[pointer]: pointer += 1 if pointer == searched_length: found = True if found: print('YES') else: print('NO')