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(); bool result = true; int startIndex = 0; foreach( char item in "hackerrank" ) { startIndex = s.IndexOf( item, startIndex ); if( startIndex == -1 ) { result = false; break; } startIndex++; } Console.WriteLine( result ? "YES" : "NO" ); } } }