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.next(); // your code goes here } for(int i = 0; i < q; i++) { if(s[i].length() < 10) { System.out.println("NO"); } if(s[i].length() >= 10) { if(s[i].contains("h") && s[i].contains("a") && s[i].contains("c") && s[i].contains("k") && s[i].contains("e") && s[i].contains("r") && s[i].contains("r") && s[i].contains("a")&& s[i].contains("n") && s[i].contains("k")) { System.out.println("YES"); }else{ System.out.println("NO"); } } } } }