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