import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); int[] result = new int[n]; int mod = n % 4; if (mod == 0) { n--; result[n] = x; n--; result[n] = 1; n--; result[n] = 100005; n--; result[n] = 100004; } else if (mod == 1) { n--; result[n] = x; } else if (mod == 2) { n--; result[n] = x ^ 1; n--; result[n] = 1; } else { n--; result[n] = x ^ 1; n--; result[n] = 100005; n--; result[n] = 100004; } int idx = 2; while (n > 0) { if (idx == x || idx + 1 == x || idx == (x ^ 1) || idx + 1 == (x ^ 1)) { idx += 2; continue; } n--; result[n] = idx; idx++; n--; result[n] = idx; idx++; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < result.length; i++) { sb.append(result[i]).append("\n"); } System.out.print(sb); } }