#!/bin/ruby q = gets.strip.to_i for a0 in (0..q-1) s = gets.strip puts s =~ /h+.*a+.*c+.*k+.*e+.*r+.*r+.*a+.*n+.*k+/i ? 'YES' : 'NO' end