T = int(input())

for j in range (0,T):
    even, odd = [],[]
    S = raw_input()
    i = 0

    for letter in S:        
        if i%2 != 0:
            odd.append(letter)
        else:
            even.append(letter)
        i += 1
    print "".join(even) + " " + "".join(odd)
