#include using namespace std; int main(){ int q; string word = "hackerrank"; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; string::iterator wordIter = word.begin(); for (string::iterator iter = s.begin(); iter != s.end(); iter++){ if (*iter == *wordIter){ wordIter++; } } string result = wordIter == word.end() ? "YES" : "NO"; cout << result << endl; } return 0; }