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()); for(int a0 = 0; a0 < q; a0++){ int h = 0, a = 0, c = 0, k = 0, e = 0, r = 0, n = 0; string s = Console.ReadLine(); for(int i = 0; i < s.Length; i++){ if(s[i] == 'h'){ h++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'a'){ a++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'c'){ c++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'k'){ k++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'e'){ e++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'r'){ r++; } } for(int i = 0; i < s.Length; i++){ if(s[i] == 'n'){ n++; } } if(h >= 1 && a >=2 && c >= 1 && k >= 2 && e >= 1 && r >= 2 && n >= 1){ Console.WriteLine("YES"); } else{ Console.WriteLine("NO"); } } } }