int main(){char i=1,j[99],c,s[99][99];for(;c=c){scanf("%d%c",&s[c][i],&j[i]);s[i][c]=s[c][i];}printf("%d%c",s[c][i],j[i]);}while(j[i++]>10);}}