import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int q = in.nextInt(); String[] s = new String[q]; for(int a0 = 0; a0 < q; a0++){ s[a0] = in.next(); } Hashtable wordBase = new Hashtable(); wordBase = createBase("hackerrank"); for(int i = 0; i< q; i++){ compareWords(wordBase, s[i]); } } public static void compareWords(Hashtable base, String word){ String[] wordArray = word.split(""); String result = "YES"; Hashtable hashword = new Hashtable(); for(int i=1; i entry : hashword.entrySet()){ if(entry.getValue() < base.get(entry.getKey())){ result="NO"; break; } } }else{ result="NO"; } System.out.println(result); } public static Hashtable createBase(String word){ Hashtable hashword = new Hashtable(); String[] wordArray = word.split(""); for(int i=1; i