#!/bin/python def check(ch): res = 0 for j in range(len(check_ch)): for i in range(len(ch_tab)): if ch_tab[i] == check_ch[j]: res += 1 break if res == len(check_ch): return "YES" else: return "NO" check_ch = ["h","a","c","k","e","r","r","a","n","k"] result = [] q = int(raw_input()) for i in range(q): ch = raw_input() ch_tab = [c0 for c0 in ch] result.append(check(ch)) for res in result: print res