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(); int i,p,j; String ss,s; String s2="hackerrank"; for(i = 0; i < q; i++){ p=0; ss=""; s= in.next(); for(j=0;j