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()); char[] x = {'h', 'a', 'c','k', 'e', 'r', }; for (int a0 = 0; a0 < q; a0++) { int[] found = { 0, 0, 0, 0, 0, 0 }; string s = Console.ReadLine(); // your code goes here for(int i = 0; i < s.Length;i++) switch (s.ElementAt(i)) { case 'h': found[0]++; break; case 'a': found[1]++; break; case 'c': found[2]++; break; case 'k': found[3]++; break; case 'e': found[4]++; break; case 'r': found[5]++; break; default: break; } if (found[1] > 1 && found[3] > 1 && found[5] > 1 && found[0] >= 1 && found[2] >= 1 && found[4] >= 1) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } }