#include using namespace std; int main(){ int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; // your code goes here string word = "hackerrank"; int sz = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == word[sz]) { sz++; } } if (word.size() == sz) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }