using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; class Solution { static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); var reg = string.Join(".*?", "hackerrank".ToCharArray()); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); bool answer = Regex.IsMatch(s, reg); Console.WriteLine(answer ? "YES" : "NO"); } } }