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[] temp = new char[]{'h','a','c','k','e','r','r','a','n','k'}; for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); // your code goes here char[] c = s.ToCharArray(); int visit = 0; foreach(char t in c ) { if(temp[visit] == t) { visit += 1; } if(visit == 10) { Console.WriteLine("YES"); break; } } if(visit != 10) Console.WriteLine("NO"); } } }