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()); var checkHackerrank = new HackerRankInString(); for (int a0 = 0; a0 < q; a0++) { string s = Console.ReadLine(); var isValid = checkHackerrank.IsValid(s); if (isValid) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } } class HackerRankInString { private char[] _word = new[] {'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n', 'k'}; public bool IsValid(string alph) { var index = 0; for (int i = 0; i < alph.Length; i++) { if (alph[i] == _word[index]) { index++; if (index == _word.Length) return true; } } return false; } }