import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Solution { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); char[] har = "hackerrank".toCharArray(); while (t-- > 0) { char[] ar = br.readLine().toCharArray(); int j = 0; for (int i=0; i