#include using namespace std; bool contains(string str1, string str2, int m, int n) { if (m == 0) return true; if (n == 0) return false; if (str1[m-1] == str2[n-1]) return contains(str1, str2, m-1, n-1); return contains(str1, str2, m, n-1); } int main(){ int q; cin >> q; string yes = "YES", no = "NO", w = "hackerrank"; int wl = w.length(); for(int a0 = 0; a0 < q; a0++){ string s; cin >> s; cout << (contains(w, s, wl, s.length()) ? yes : no) << endl; } return 0; }