#!/bin/python3 import sys myStr = 'hackerrank' myCounter = 0 q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here for i in range(len(s)): if s[i] == myStr[myCounter]: myCounter += 1 if myCounter > 9: print('YES') else: print('NO') myCounter = 0