import sys for x,y in sorted([(0,'')]+[(y%2,y)for y in map(int,sys.stdin)]):print y