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