#!/usr/bin/env python3
# NOTE: it is recommended to use this even if you don't understand the following code.


# input data
T = int(input())
for _ in range(T):
    S = input().strip()

    # insert your code here


    print(-1)  # print the result
