#!/bin/python3 import sys def hasHackerRankString(s): s_find = "hackerrank" size_find = len(s_find) size_s = len(s) if(size_s < size_find): print("NO") else: i_s = 0 i_f = 0 no_stop = True while(no_stop): if(s_find[i_f] == s[i_s]): i_f += 1 i_s += 1 if(i_f == size_find): print("YES") no_stop = False elif(i_s == size_s): print("NO") no_stop = False else: i_s += 1 if(i_s == size_s): print("NO") no_stop = False q = int(input().strip()) for a0 in range(q): s = input().strip() hasHackerRankString(s)