t=table f=function(r)for i=1,#t do _=t[i]%2~=r or print(t[i])end end for n in io.lines()do t[#t+1]=n+0 end t:sort()f(0)print()f(1)