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(); // your code goes here //int aCount = s.Count( a => a.Equals('a')); if(s.Contains('h') && s.Contains('a') && s.Count( a => a.Equals('a')) >= 2 && s.Contains('c') && s.Contains('k') && s.Count( a => a.Equals('k')) >= 2 && s.Contains('e') && s.Contains('r') && s.Count( a => a.Equals('r')) >= 2 && s.Contains('n') ) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }