import java.util.Arrays;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Long n[] = new Long[sc.nextInt()];
		int even = 0;
		int odd = 0;
		for(int i = 0;i<n.length;i++) {
			n[i] = sc.nextLong();
			if(n[i]%2==0) even++;
			else odd++;
		}
		if(odd == 0 | even == 0)  {
			Arrays.sort(n);
			for(int i=0;i<n.length;i++) {
				if(even==0) {
					if(n[i]%2==1)System.out.println(n[i]);
				}
				else {
					if(n[i]%2==0)System.out.println(n[i]);
				}
			}
		}
		else System.out.println(0);
		

	}

}

   	   		 									 	      		 	