#!/bin/python import sys find_str = 'hackerrank' q = int(raw_input().strip()) for a0 in xrange(q): found_match = True s = raw_input().strip() # your code goes here for letter in find_str: index = s.find(letter) if index == -1: print 'NO' found_match = False break else: s = s[index+1:] if found_match: print 'YES'