#include #include #include #include #include using namespace std; const string hack = "hackerrank"; int main() { int q; cin >> q; string ans = "YES"; for (int i = 1; i <= q; i++){ string s; cin >> s; int len = s.size(); int pos = 0; int count = 0; for (int j = 0; j < 10; j++){ for (int k = pos; k < len; k++){ if (s[k] == hack[j]) { pos = 0; pos += k + 1; count += 1; break; } } } if (count == 10){ cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }