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) { Scanner in = new Scanner(System.in); int q = in.nextInt(); String[] s = new String[q]; for(int a0 = 0; a0 < q; a0++){ s[a0] = in.nextLine(); } String str = "hackerrank"; char[] ptr = str.toCharArray(); for( int i = 0 ; i < q ; i++ ) { int l = 0 ; char[] arr = s[i].toCharArray(); for(int j = 0 ; j < s[i].length() ; j++ ) { if((ptr[l] == arr[j]) && (l != str.length())) l++; } if(l != str.length()) System.out.println("YES"); else System.out.println("NO"); } } }