#include #include #include #include #include #include #include char* f(char *s) { int flag=0,i,j=0; char *h="hackerrank"; if(strlen(h)>strlen(s)) return "NO"; else{ for(i=0;s[i]!='\0';i++) { if(s[i]==h[j]) { j++; } } if(j==strlen(h)) return "YES"; else return "NO"; } } int main(){ int q; scanf("%d",&q); for(int a0 = 0; a0 < q; a0++){ char* s = (char *)malloc(512000 * sizeof(char)); scanf("%s",s); printf("%s\n",f(s)); } return 0; }