import java.util.*;
class Main{
static int mininum(int n){
int ans=0;
Stack<Integer> stack1=new Stack<Integer>();
Stack<Integer> stack2=new Stack<Integer>();
while(n!=0){
int r=n%10;
if(r%2==0){
stack1.add(r);
}else{
stack2.add(r);
}
n=n/10;
}
while(!stack1.isEmpty()&&!stack2.isEmpty()){
if(stack1.peek()<stack2.peek()){
ans=ans*10+stack1.peek();
stack1.pop();
}else{
ans=ans*10+stack2.peek();
stack2.pop();
}
}
while(!stack2.isEmpty()){
ans=ans*10+stack2.peek();
stack2.pop();
}
return ans;
}
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int n=sc.nextInt();
int[] b=new int[n];
int num=0;
for(int i=0;i<b.length;i++){
b[i]=sc.nextInt();
num=num*10+b[i];
}
System.out.print(mininum(num)+" ");
}
}
}
拓展:若输入的是整数数组,返回的最小数列是什么?