n=int(input()) for i in range(0,n): s=input() pos=0 st="hackerrank" p=0 while(pos