local n, k = io.read("*n", "*n") local normal = n - k local t = {4, 1, 3, 2} for i = 1, n - k do if(i ~= 1) then io.write(" ") end io.write(t[i % 4 + 1]) end local of = {5, 4, 6, 3} local offset = of[(n - k) % 4 + 1] for i = n - k + 1, n do if(i ~= 1) then io.write(" ") end io.write(offset) end io.write("\n")