using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Collections; class Solution { static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); Stack myStack = new Stack(); myStack.Push( 'k' ); myStack.Push( 'n' ); myStack.Push( 'a' ); myStack.Push( 'r' ); myStack.Push( 'r' ); myStack.Push( "e" ); myStack.Push( "k" ); myStack.Push( "c" ); myStack.Push( "a" ); myStack.Push( "h" ); foreach (char c in s) { if(Convert.ToChar(myStack.Peek())==c) { myStack.Pop(); } if(myStack.Count==0) { break; } } if(myStack.Count==0) { Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }