n=int(input()) arr=[] for i in range (n): a=input() arr.append(a) for i in arr: res="" for j in range (0,len(i),2): res+=i[j+1]+i[j] print(res)