import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
int x;
Scanner in
= new Scanner
(System.
in);
while(true)
{
try{
x = in.nextInt();
if(x%2==0) Even.addElement(x);
else Odd.addElement(x);
}
{
break;
}
}
for(int i=0;i<Even.size();i++)
{
System.
out.
print(Even.
get(i
) + " "); }
for(int i=0;i<Odd.size();i++)
{
System.
out.
print(Odd.
get(i
) + " "); }
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CiAKY2xhc3MgSWRlb25lCnsKICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KICB7CglpbnQgeDsKCVZlY3RvciBPZGQgPSBuZXcgVmVjdG9yKCk7CglWZWN0b3IgRXZlbiA9IG5ldyBWZWN0b3IoKTsKCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCgl3aGlsZSh0cnVlKSAKCXsKCQl0cnl7CgkJCXggPSBpbi5uZXh0SW50KCk7CgkJCQogICAgCQkJaWYoeCUyPT0wKSBFdmVuLmFkZEVsZW1lbnQoeCk7CiAgICAJCQllbHNlIE9kZC5hZGRFbGVtZW50KHgpOwoJCX0KCQljYXRjaCAoRXhjZXB0aW9uIG9iaikKCQl7CgkJCQogICAgCQkJYnJlYWs7CgkJfQoJfQoJZm9yKGludCBpPTA7aTxFdmVuLnNpemUoKTtpKyspCgl7CgkJU3lzdGVtLm91dC5wcmludChFdmVuLmdldChpKSArICIgIik7Cgl9CiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoIlxuIik7Cglmb3IoaW50IGk9MDtpPE9kZC5zaXplKCk7aSsrKQoJewoJCVN5c3RlbS5vdXQucHJpbnQoT2RkLmdldChpKSArICIgIik7Cgl9CQogIH0KfQ==