import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static final String X = "hackerrank"; public static void main(String[] args) { Scanner in = new Scanner(System.in); int q = in.nextInt(); for(int i = 0; i < q; i++){ String s = in.next(); char[] hackerrank = X.toCharArray(); int cursor = 0; for(char c : s.toCharArray()){ if(hackerrank[cursor] == c){ cursor++; } } System.out.println((cursor == hackerrank.length)? "YES":"NO"); } } }