#!/bin/python3 import sys def contains_hackerrank(s): hr = "hackerrank" hr_index = 0 search_index = 0 while(search_index < len(s) and hr_index < len(hr)): if(s[search_index:search_index+1] == hr[hr_index:hr_index+1]): hr_index = hr_index + 1 search_index = search_index + 1 if(hr_index == len(hr)): return True else: return False q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here if(contains_hackerrank(s)): print("YES") else: print("NO")