for _ in range(int(input())): s=input() r=re.sub(r"\D", "", s) R=int(r) print("Hitsuji ga",R+1,"hiki")