#!/bin/python3 import sys word = 'hackerrank' q = int(input().strip()) for a0 in range(q): s = input().strip() i , j = 0 , 0 while(i < len(s) and j < len(word)): if word[j] == s[i]: i += 1 j += 1 else: i += 1 print('YES' if j == len(word) else 'NO') # your code goes here