#!/bin/python3 import sys target = "hackerrank" q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here pos = 0 for char in s: if char == target[pos]: pos += 1 if pos == 10: break print("YES" if pos == 10 else "NO")