n=int(input()) for i in range(n): s=input() res="" for j in range(0,len(s)-1,2): res=res+s[j+1]+s[j] print(res)