inputer =int(input()) result="" for numer in range(inputer): dat_s=input() if dat_s[1:] =="0": result = result+dat_s[:2] else: result = dat_s[:2] +result print(result)