#include using namespace std; int main(){ int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; int pos = -1; for (char c : string("hackerrank")) { pos = s.find(c, pos+1); if (pos == string::npos) break; } if (pos != string::npos) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }