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

n = int(sys.argv[1])
q = int(sys.argv[2])
maxa = int(sys.argv[3])
maxk = int(sys.argv[4])
type = sys.argv[5]
seed = int(sys.argv[6])

random.seed(seed)

import math

print(n, q)
m = 1
k = 1
a = []
if type == "1_NO":
    a1 = random.randint(1, maxa)
    k = random.randint(1, a1 // 2)
    if a1 % k == 0:
        k += 1
    a.append(a1)
elif type == "1_YES_small":
    a1 = random.randint(1, maxa)
    k = random.randint(1, a1 // 2)
    if a1 % k != 0:
        k += (a1 - a1 % k)
    a.append(a1)
elif type == "1_large":
    a1 = random.randint(1, n)
    k = random.randint(a1, n)
    a.append(a1)
elif type == "2_NO":
    a1 = random.randint(1, maxa)
    if a1 % 2 == 0:
        a1 += 1
    a2 = random.randint(1, a1 // 2)
    m = 2
    k = 2
    a.append(a1)
    a.append(a2)
elif type == "2_YES":
    a1 = random.randint(1, maxa)
    if a1 % 2 == 0:
        a1 += 1
    a2 = random.randint(a1 // 2, a1 - 1)
    m = 2
    k = 2
    a.append(a1)
    a.append(a2)

for _ in range(n - m):  
    a.append(1)
print(*a)

for _ in range(q):
    print(k)