for v in sorted([(v%2,v)for v in map(int,open('../fd/0'))]+[(0,"")]):print v[1]