#include using namespace std; char s[10010]; char t[] = "hackerrank"; int main(){ int q; scanf("%d", &q); while(q--) { scanf("%s", s); int i = 0, j = 0; while(s[i] && t[j]) { if (s[i] == t[j]) ++j; ++i; } printf("%s\n", t[j] == 0 ? "YES" : "NO"); } return 0; }