#include #include #include #include const std::string valid = "hackerrank"; bool check(const std::string &sequence) { int i = 0; for (char ch : sequence) { if (ch == valid[i] && ++i >= valid.size()) return true; } return false; } int main() { int count; std::cin >> count; for (int i = 0; i < count; ++i) { std::string sequence; std::cin >> sequence; std::cout << (check(sequence) ? "YES" : "NO") << std::endl; } return 0; }