#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here pal = "hackerrank" start = 0 for ch in pal: i = s.find(ch, start) if i != -1: start = i + 1 else: print("NO") break else: print('YES')