import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { String found = "NO"; int mainStart = 0; int start =0; Scanner in = new Scanner(System.in); int q = in.nextInt(); for(int a0 = 0; a0 < q; a0++){ String str1 = in.next(); String str = "hackerrank"; found = "NO"; mainStart = 0; start =0; if(str1.length() >= str.length() ){ while(start < str1.length()){ if(str.charAt(mainStart) == str1.charAt(start)){ mainStart++; found = "YES"; start++; }else{ start++; } } if(mainStart != str.length()){ found = "NO"; } System.out.println(found); }else{ System.out.println("NO"); } } } }