t = int(input()) for _ in range(t): w = input() w = w[0:len(w)-2] print(w+"i")