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(); string hacker = "hackerrank"; char c = hacker[0]; int counter = 0; for (int i = 0; i < s.Length; i++) { if (s[i] == c) { counter++; if (counter==hacker.Length) { break; } c = hacker[counter]; } } if (counter==hacker.Length) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }