import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int q = in.nextInt(); if ((q <2 ) || (q > 100)) { throw new IllegalArgumentException("value is out of range"); } String[] stringArray = new String[q]; for (int a0 = 0; a0 < q; a0++) { String s = in.next(); if ((s.length() <10 ) || (s.length() > 10000)) { throw new IllegalArgumentException("value is out of range"); } stringArray[a0] = s; } Solution solution = new Solution(); for (int i = 0; i < q; i++) { boolean x=solution.getWord(stringArray[i]); if(x==true){System.out.println("YES");} else{System.out.println("NO");} } } public boolean getWord(String stringArray) { boolean x=false; Pattern p1 = Pattern.compile("h"); Matcher m1 = p1.matcher(stringArray.toLowerCase()); while(m1.find()){ String s1 = stringArray.substring(m1.start()); Pattern p2 = Pattern.compile("a"); Matcher m2 = p2.matcher(stringArray.toLowerCase()); while(m2.find()){ String s2 = stringArray.substring(m2.start()); Pattern p3 = Pattern.compile("c"); Matcher m3 = p3.matcher(stringArray.toLowerCase()); while(m3.find()){ String s3 = stringArray.substring(m3.start()); Pattern p4 = Pattern.compile("k"); Matcher m4 = p4.matcher(stringArray.toLowerCase()); while(m4.find()){ String s4 = stringArray.substring(m4.start()); Pattern p5 = Pattern.compile("e"); Matcher m5 = p5.matcher(stringArray.toLowerCase()); while(m5.find()){ String s5 = stringArray.substring(m5.start()); Pattern p6 = Pattern.compile("r"); Matcher m6 = p6.matcher(stringArray.toLowerCase()); while(m6.find()){ String s6 = stringArray.substring(m6.start()); Pattern p7 = Pattern.compile("r"); Matcher m7 = p7.matcher(stringArray.toLowerCase()); while(m7.find()){ String s7 = stringArray.substring(m7.start()); Pattern p8 = Pattern.compile("a"); Matcher m8 = p8.matcher(stringArray.toLowerCase()); while(m8.find()){ String s8 = stringArray.substring(m8.start()); Pattern p9 = Pattern.compile("n"); Matcher m9 = p9.matcher(stringArray.toLowerCase()); while(m9.find()){ String s9 = stringArray.substring(m9.start()); Pattern p10 = Pattern.compile("k"); Matcher m10 = p10.matcher(stringArray.toLowerCase()); x=true; } } } } } } } } } return x; } }