using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); int h=0,a=0,c=0,k=0,e=0,r=0,n=0; for(int i=0; i < s.Length; i++){ char temp = s[i]; switch(temp){ case 'h':h++;break; case 'a':a++;break; case 'c':c++;break; case 'k':k++;break; case 'e':e++;break; case 'r':r++;break; case 'n':n++;break; } } if(h>0 && a>1 && c>0 && k>1 && e>0 && r>1 && n>0 ){ Console.WriteLine("YES"); } else{ Console.WriteLine("NO"); } } } }