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()); int[] positions = new int[10]; string hr = "hackerrank"; for (int a0 = 0; a0 < q; a0++) { string s = Console.ReadLine(); int counter = 0; for (int l = 0; l < s.Length; l++) { if (s[l] == hr[counter]) counter++; if (counter == 10) break; } if (counter == hr.Length) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } }