using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static bool ContainsWord(string str, string word) { int strLength = str.Length; int wordLength = word.Length; int j = 0; for(int i = 0; i < wordLength; i++) { for(;j < strLength; j++) { if(str[j] == word[i]) { j++; break; } } if(j == strLength && i < wordLength -1) return false; } return true; } static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); if(ContainsWord(s, "hackerrank")) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } }