#include #define f first #define s second #define pb push_back #define ppb pop_back #define mp make_pair #define ld long double #define ll long long #define ull unsigned ll #define pii pair #define pll pair #define bit(x) __builtin_popcountll(x) #define all(x) x.begin(), x.end() #define sqr(x) ((x) * 1ll * (x)) #define sz(x) (int)x.size() #define purple ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0); #define rep(_i, _from, _to) for (int _i = _from; _i <= _to; ++_i) #define per(_i, _from, _to) for (int _i = _from; _i >= _to; --_i) #define nl '\n' #define ioi exit(0); #define _18day "maxcross" using namespace std; const int N = 1e6 + 7, mod = 1e9 + 7, inf = 1e9 + 7; const ll linf = (ll)1e18 + 7; const ld eps = 1e-15, pi = 3.141592; const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; int t; string k = "hackerrank"; inline string solve() { int ptr = 0; string s; cin >> s; rep(i, 0, sz(s) - 1) { if (s[i] == k[ptr] && ptr < sz(k)) ptr++; } if (ptr == sz(k)) return "YES\n"; return "NO\n"; } int main() { #ifndef _18day freopen (_18day".in", "r", stdin); freopen (_18day".out", "w", stdout); #endif cin >> t; while (t--) cout << solve(); ioi }