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