{"raw_statement":[{"iden":"statement","content":"Setsuna has been fascinated by coprime pairs recently, so she decided to play a game about numbers.\n\nHere are $n$ integers $a_1, a_2, \\\\\\\\cdots, a_n (2 <= a_i <= 10^(18))$. Setsuna wants to divide the numbers into as few groups as possible so that each number is exactly in one group and the numbers in each group are coprime with each other.\n\nWe say that positive integers $x$ and $y$ are coprime if and only if $gcd (x, y) = 1$, where $gcd (x, y)$ refers to their greatest common divisor.\n\nHowever, Setsuna is not good at math, so she only comes up with a fake algorithm.\n\nHer greedy algorithm is obviously wrong, so we need to hack her solution.\n\nYou are given one integer $k$. You need to find the input consisting of $n (n <= 300)$ integers and a corresponding partition to the input(*not necessarily* be the minimum partition), which satisfies $X = Y + k$, where $Y$ is the number of groups of your partition and $X$ is the answer of her algorithm to your input.\n\nIt can be proved that the answer always exists.\n\nThe input contains one integer $k (1 <= k <= 7)$.\n\nIn the first line, output two integers $n, Y (1 <= Y <= n <= 300)$.\n\nIn the second line, output $n$ integers $a_1, a_2, \\\\\\\\cdots, a_n (2 <= a_i <= 10^(18))$, separated by spaces.\n\nIn the third line, output $n$ integers $G_1, G_2, \\\\\\\\cdots, G_n (1 <= G_i <= Y)$, separated by spaces, where $g_i$ indicates which group is $a_i$ divided into.\n\nIf there are multiple solutions, you can output any.\n\nIn the sample, Setsuna will get $3$ groups: ${8, 3}, {45}, {100}$, but we have a better partition: ${8, 45}, {3, 100}$.\n\n"},{"iden":"input","content":"The input contains one integer $k (1 <= k <= 7)$."},{"iden":"output","content":"In the first line, output two integers $n, Y (1 <= Y <= n <= 300)$.In the second line, output $n$ integers $a_1, a_2, \\\\\\\\cdots, a_n (2 <= a_i <= 10^(18))$, separated by spaces.In the third line, output $n$ integers $G_1, G_2, \\\\\\\\cdots, G_n (1 <= G_i <= Y)$, separated by spaces, where $g_i$ indicates which group is $a_i$ divided into.If there are multiple solutions, you can output any."},{"iden":"note","content":"In the sample, Setsuna will get $3$ groups: ${8, 3}, {45}, {100}$, but we have a better partition: ${8, 45}, {3, 100}$."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ a, b, c \\in \\{0, 1, \\dots, 9\\} $ be the allowed digits.  \nLet $ \\mathcal{D} = \\{a, b, c\\} $ be the set of permitted digits.  \nA number $ n \\geq 10 $ is a *Perfect Rose* if:  \n- All its digits belong to $ \\mathcal{D} $,  \n- It contains no leading zeros,  \n- One of its digits equals the arithmetic mean of all other digits.  \n\nLet $ q \\in \\mathbb{Z}^+ $ be the number of shops.  \nFor each shop $ k \\in \\{1, \\dots, q\\} $, let $ [L_k, R_k] $ be the range of rose numbers sold, with $ 0 \\leq L_k \\leq R_k \\leq 10^9 $.  \n\n**Constraints**  \n1. $ 1 \\leq q \\leq 10^5 $  \n2. $ 0 \\leq a, b, c \\leq 9 $  \n3. $ 0 \\leq L_k \\leq R_k \\leq 10^9 $ for all $ k \\in \\{1, \\dots, q\\} $  \n4. Numbers must not have leading zeros.  \n5. 1-digit numbers are excluded from being Perfect Roses.  \n\n**Objective**  \nFor each shop $ k $, compute:  \n$$\nP_k = \\left| \\left\\{ n \\in [L_k, R_k] \\mid n \\text{ is a Perfect Rose} \\right\\} \\right|\n$$  \nFind the shop index $ k^* = \\min \\left\\{ k \\in \\{1, \\dots, q\\} \\mid P_k = \\max_{1 \\leq j \\leq q} P_j \\right\\} $.  \n\nOutput $ k^* $.","simple_statement":"Find the shop (1 to q) that has the most perfect roses in range [L, R].  \nA perfect rose is a number with 2+ digits, no leading zeros, made only from digits a, b, c, and one digit equals the average of all others.  \nIf multiple shops tie, pick the smallest shop number.","has_page_source":false}