#!/bin/python3 def contains(s, s1): if not s1: return True; try: i = s.index(s1[0]) except ValueError: return False else: return contains(s[i+1:], s1[1:]) q = int(input().strip()) for a0 in range(q): s = input().strip() s1 = 'hackerrank' print('YES' if contains(s, s1) else 'NO')