#include #include #include #include #include using namespace std; bool findword(string s) { int index = 0; string name = "hackerrank"; for(int i = 0; i < 10; i++) { if(i == 6) index++; int found = s.find(name[i],index); if ( found < s.length() ) index = found; else return false; } return true; } int main() { int n; cin >> n; //string me = "hackerworld"; while(n){ string s; cin >> s; if(findword(s) == true) cout << "YES" << endl; else cout << "NO" << endl; n--; } return 0; }