#include #include #include #include #include #include #include int main(){ int q; scanf("%d",&q); for(int a0 = 0; a0 < q; a0++){ char* s = (char *)malloc(512000 * sizeof(char)); scanf("%s",s); // your code goes here int i = 0; int check = 0; char c = s[i]; int result = 0; while (c != '\0') { switch (check) { case 0 : if (c == 'h') check++; break; case 1 : if (c == 'a') check++; break; case 2 : if (c == 'c') check++; break; case 3 : if (c == 'k') check++; break; case 4 : if (c == 'e') check++; break; case 5 : if (c == 'r') check++; break; case 6 : if (c == 'r') check++; break; case 7 : if (c == 'a') check++; break; case 8 : if (c == 'n') check++; break; case 9 : if (c == 'k') check++; break; } i++; c = s[i]; } if (check == 10) printf("YES\n"); else printf("NO\n"); } return 0; }