a=[i=0] System.in.eachLine{s->for(a[j=++i]=s.split();--j;)s=a[j][i-j]+' '+s println s}