#include using namespace std; long long _abs(long long x){return (x < 0)? -x:x;} string hck = "hackerrank"; bool check(string s){ int st = 0; for(int i = 0; i < s.length() && st < 10; i++){ if(s[i] == hck[st]) st++; } if(st == 10) return true; return false; } int main(){ int t; cin >> t; while(t--){ string s; cin >> s; if(check(s)) cout << "YES\n"; else cout << "NO\n"; } return 0; }