#!/usr/bin/env python3
import sys, random


def next_index(a, x, m):
    mini = -1
    maxi = m
    while mini + 1 != maxi:
        mid = (mini + maxi) // 2
        if a[mid][-1] > x:
            maxi = mid
        else:
            mini = mid
    return mini


def cmdlinearg(name, default=None):
    for arg in sys.argv:
        if arg.startswith(name + "="):
            return arg.split("=")[1]
    assert default is not None, name
    return default


random.seed(int(cmdlinearg("seed", sys.argv[-1])))


MAXN = int(sys.argv[1])
MAXM = int(sys.argv[2])
N = int(cmdlinearg("N", MAXN))

print(N, 1)

a = list(range((N-1)//2,N))
a = [0] + a
who = [a[j] for j in range(-1, len(a))]
who[0] = len(a)
print(" ".join(str(x) for x in who))
