for(A=[,],B=[];$=readline();)with($&1?B:A)push($),sort(function(a,b)a-b);print(A.concat(B).join("\n"))