#include #include using namespace std; int main(){ int q; cin >> q; string hackerrank = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; int hack_index = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == hackerrank[hack_index]) hack_index++; if (hack_index == 9) { break; } } if (hack_index == 9) { cout << "YES" << endl; } else cout << "NO" << endl; } return 0; }