#!/bin/python import sys def contains_hackerrank(s): hr = 'hackerrank' found, i, j = 0, 0, 0 while i < len(hr) and j < len(s): if hr[i] == s[j]: i+=1 found += 1 j += 1 return found == len(hr) q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() print "YES" if contains_hackerrank(s) else "NO" # your code goes here