#!/bin/python import sys, string q = int(raw_input().strip()) template = 'hackerrank' for a0 in xrange(q): s = raw_input().strip() # your code goes here result = 'YES' for char in template: index = string.find(s, char) if index >= 0: s = s[index + 1:] else: result = 'NO' break; print result