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); List word = Arrays.asList("h","a","c","k","e","r","r","a","n","k"); Integer indexWord = 0; int q = in.nextInt(); for(int a0 = 0; a0 < q; a0++){ String s = in.next(); boolean print = true; for(char w : s.toCharArray()) { if(w == word.get(indexWord).charAt(0)){indexWord++; print=true; continue;} else{print = false;} } System.out.println(print == true ? "YES" : "NO"); indexWord = 0; } } }