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