package no334; import java.util.Scanner; public class Main { static int n; static int[] k; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); k = new int[n]; for(int i=0;i> j & 1) == 1) { use[ind++] = j; } } if (isKadomatsuSequence(k[use[0]], k[use[1]], k[use[2]])) { if (dfs(m & ~i) == Integer.MAX_VALUE) { ret = Math.min(ret, use[0] * 10000 + use[1] * 100 + use[2]); } } } return memo[m] = ret; } public static boolean isKadomatsuSequence(long a,long b,long c) { if (a == b || b == c) { return false; } return b < a && b < c || b > a && b > c; } }