import java.io.PrintWriter;
import java.util.*;

public class GenRandom {

    public final static int SEED = "bookshelf-sorting".hashCode();
    public final static Random rng = new Random(SEED);
    public final static int ARGS_COUNT = 2;
    public final static int MAX = 200000;

    enum PositionMode {
        FIRST,
        LAST,
        RANDOM,
    }

    public static void main(String[] args) {
        if (args.length < ARGS_COUNT) {
            throw new IllegalArgumentException(
                    String.format("Expected %d arguments, but got %d instead", ARGS_COUNT, args.length));
        }
        rng.setSeed(Arrays.hashCode(args));
        int n = Integer.parseInt(args[0]);
        int k = Integer.parseInt(args[1]);
        PositionMode mode = PositionMode.RANDOM;
        if (args.length >= 3) {
            try {
                mode = PositionMode.valueOf(args[2]);
            } catch (IllegalArgumentException e) {
                mode = PositionMode.RANDOM;
            }
        }
        generateRandom(n, k, mode).print();
    }

    static TestCase generateRandom(int n, int k, PositionMode mode) {
        TreeSet<Integer> set = new TreeSet<>();
        while (set.size() < k) {
            set.add(rng.nextInt(n));
        }
        int[] questions = set.stream().mapToInt(i -> i).toArray();
        int s;
        switch (mode) {
            case FIRST: s = questions[0]; break;
            case LAST: s = questions[k - 1]; break;
            default: s = questions[rng.nextInt(k)]; break;
        }
        return new TestCase(n, s, questions);
    }

    private static int[] randomPermutation(int n) {
        int[] result = new int[n];
        for (int i = 0; i < n; i++) {
            int pos = rng.nextInt(i + 1);
            result[i] = result[pos];
            result[pos] = i;
        }
        return result;
    }

    static class TestCase {
        int n, s;
        int[] questions;

        public TestCase(int n, int s, int[] questions) {
            this.n = n;
            this.s = s;
            this.questions = questions;
        }

        public void print() {
            try (PrintWriter out = new PrintWriter(System.out)) {
                out.println(n + " " + questions.length + " " + (s + 1));
                for (int i = 0; i < questions.length; i++) {
                    out.print(questions[i] + 1);
                    if (i + 1 == questions.length) {
                        out.println();
                    } else {
                        out.print(' ');
                    }
                }
            }
        }
    }
}
