i=0 while 1: s=raw_input().split()*99 if s:print s[i],;i+=1