q = io.read("*number", "*l") a0 = 0 while a0 < q do s = io.read() x = 1 y = 1 HR = {'h', 'a', 'c', 'k', 'e', 'r', 'r', 'a', 'n', 'k'} --10 letters repeat if string.char(string.byte(s, x)) == HR[y] then y = y+1 if y == 11 then print("YES") end end x = x+1 until string.byte(s, x) == nil or y == 11 if y < 11 then print("NO") end a0 = a0 + 1 end