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(); for(int a0 = 0; a0 < q; a0++){ String s = in.next(); // your code goes here /*String[] cnth=s.split("h"); String[] cnta=s.split("a"); String[] cntc=s.split("c"); String[] cntk=s.split("k"); String[] cnte=s.split("e"); String[] cntr=s.split("r"); String[] cntn=s.split("n"); int cntmo=0; // System.out.println(cnth.length +" "+cnta.length +" "+cntc.length +" "+cntk.length +" "+cnte.length +" "+cntr.length +" "+cntn.length +" "+" 0"); if(cnth.length>=2 && cnta.length>=3 && cntc.length>=2 && cntk.length>=3 && cntr.length>=3 && cntn.length>=2 && cnte.length>=2) System.out.println("Yes"); else System.out.println("No");*/ HashMap hm=new HashMap(); char arr[]=s.toCharArray(); for(int i=0;i=1 && hm.get('a')>=2 && hm.get('c')>=1 && hm.get('k')>=1 && hm.get('e')>=1 && hm.get('r')>=2 && hm.get('n')>=1 && hm.get('k')>=2) { System.out.println("YES"); } else System.out.println("NO"); } } }