object Main extends App {
	val N = scala.io.StdIn.readInt
	var A = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	var test = List[Long]()
	val a: Int = N%2

	for(i<-0 until N){
		if(A(i)%2 == a){
			test = A(i)::test
		}else{
			test = test:+A(i)
		}
	}

	println(test.mkString(" "))

}

