import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int x = Integer.parseInt(sa[1]); br.close(); int n4 = n % 4; if (n4 == 0) n4 = 4; int x4 = x % 4; int l = x - x4; int r = x - x4 + 4; int end = n - n4 + 4; if (4 <= x && x < 8) end += 4; for (int i = 4; i < end; i++) { if (l <= i && i < r) { continue; } System.out.println(i); } switch (n4) { case 1: System.out.println(x); break; case 2: System.out.println(x % 2 == 0 ? x + 1 : x - 1); System.out.println(1); break; case 3: System.out.println(x % 2 == 0 ? x + 1 : x - 1); System.out.println(2); System.out.println(3); break; default: System.out.println(x); System.out.println(1); if (x4 < 2) { System.out.println(x - x4 + 2); System.out.println(x - x4 + 3); } else { System.out.println(x - x4); System.out.println(x - x4 + 1); } } } }