import java.util.Scanner; public class hackerrank { public static void main(String[] args){ Scanner kb=new Scanner(System.in); int x=Integer.parseInt(kb.nextLine()); char[] hr="hackerrank".toCharArray(); for(;x>0;x--){ char[] s=kb.nextLine().toCharArray(); int i=0; boolean[] there=new boolean[hr.length]; for(char c:s) if(c==hr[i]){ there[i]=true; i++; if(i>=there.length) break; } if(there[hr.length-1]) System.out.println("YES"); else System.out.println("NO"); } } }