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(); Boolean result = true; for(int a0 = 0; a0 < q; a0++){ String s = in.next(); // your code goes here int [] stuff = {1,2,1,2,1,2,1}; for(int i=0; i < s.length();i++) { switch(s.charAt(i)){ case 'h': stuff[0]--; break; case 'a': stuff[1]--; break; case 'c': stuff[2]--; break; case 'k': stuff[3]--; break; case 'e': stuff[4]--; break; case 'r': stuff[5]--; break; case 'n': stuff[6]--; break; default: break; } } for(int a : stuff){ if(a>0){ result = false; } } if(result){ System.out.println("YES"); } else { System.out.println("NO"); } } } }