#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() hackerrank = list('hackerrank') # your code goes here for char in s: if len(hackerrank) == 0: break else: if char==hackerrank[0]: hackerrank.pop(0) if len(hackerrank) == 0: print('YES') else: print('NO')