#!/bin/python3 import re q = int(input().strip()) for i in range(q): x=input() pat='.*'.join('hackerrank') if re.search(pat,x) : print('YES') else : print('NO') # your code goes here