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[] hackerString = "hackerrank".ToCharArray(); for(int a0 = 0; a0 < q; a0++){ int hackerFindIdx = 0; string s = Console.ReadLine(); char[] sChar = s.ToCharArray(); for(int i = 0; i < s.Length; i++) { if(s[i] == hackerString[hackerFindIdx]) hackerFindIdx += 1; if(hackerFindIdx == 9) { break; } } if(hackerFindIdx == 9) { Console.WriteLine("YES"); } else Console.WriteLine("NO"); } } }