{"raw_statement":[{"iden":"statement","content":"There are $N$ different types of pieces, numbered from $1$ to $N$, the $i$-th of them having length $L_i$ and, for each type, there are exactly $10^9$ pieces of it. A tower is a sequence of pieces, where the tower's height is the summation of the lengths of the pieces in it.\n\nYou just made two new friends: Serra and Beza! They have towers of height $A$ and $B$, respectively. If the height of their towers is different, one of them becomes sad. Therefore, in order to help your friends, you decided you're gonna distribute some pieces in such a way that the height of their towers become equal. Show the set of pieces that must be given to each one of them.\n\nThe first line of input contain two integers $A$ and $B$ $(1 <= A, B <= 10^9)$, representing the initial height of the towers of Serra and Beza, respectively.\n\nThe second line contains an integer $N$ $(1 <= N <= 10^5)$, the number of different types of pieces.\n\nThe third line contains $N$ integers $L_i$ $(1 <= L_i <= 10^4)$, where $L_i$ is the length of the pieces of the $i$-th type.\n\nYou must output two blocks of $N$ lines each. The first line contains the set of pieces given to Serra, and the second line, the set of pieces given to Beza.\n\nThe $i$-th line of the first block must have a single integer $a_i$, denoting the number of pieces of the $i$-th type you must give to Serra.\n\nThe $i$-th line of the first block must have a single integer $b_i$, denoting the number of pieces of the $i$-th type you must give to Beza.\n\nNote that the output must obey $a_i + b_i <= 10^9$, for all $i$ $(1 <= i <= N)$.\n\nIt is guaranteed that there is always an answer. If there is more than one correct solution, you can output any of them.\n\n"},{"iden":"input","content":"The first line of input contain two integers $A$ and $B$ $(1 <= A, B <= 10^9)$, representing the initial height of the towers of Serra and Beza, respectively.The second line contains an integer $N$ $(1 <= N <= 10^5)$, the number of different types of pieces.The third line contains $N$ integers $L_i$ $(1 <= L_i <= 10^4)$, where $L_i$ is the length of the pieces of the $i$-th type."},{"iden":"output","content":"You must output two blocks of $N$ lines each. The first line contains the set of pieces given to Serra, and the second line, the set of pieces given to Beza.The $i$-th line of the first block must have a single integer $a_i$, denoting the number of pieces of the $i$-th type you must give to Serra.The $i$-th line of the first block must have a single integer $b_i$, denoting the number of pieces of the $i$-th type you must give to Beza.Note that the output must obey $a_i + b_i <= 10^9$, for all $i$ $(1 <= i <= N)$.It is guaranteed that there is always an answer. If there is more than one correct solution, you can output any of them."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ A, B \\in \\mathbb{Z}^+ $ be the initial heights of Serra’s and Beza’s towers.  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of piece types.  \nLet $ L = (L_1, L_2, \\dots, L_N) \\in \\mathbb{Z}^N $ be the lengths of the piece types.  \nLet $ a = (a_1, a_2, \\dots, a_N) \\in \\mathbb{Z}_{\\geq 0}^N $ be the number of pieces of each type given to Serra.  \nLet $ b = (b_1, b_2, \\dots, b_N) \\in \\mathbb{Z}_{\\geq 0}^N $ be the number of pieces of each type given to Beza.  \n\n**Constraints**  \n1. $ 1 \\le A, B \\le 10^9 $  \n2. $ 1 \\le N \\le 10^5 $  \n3. $ 1 \\le L_i \\le 10^4 $ for all $ i \\in \\{1, \\dots, N\\} $  \n4. $ a_i + b_i \\le 10^9 $ for all $ i \\in \\{1, \\dots, N\\} $  \n\n**Objective**  \nFind $ a, b $ such that:  \n$$\nA + \\sum_{i=1}^N a_i L_i = B + \\sum_{i=1}^N b_i L_i\n$$","simple_statement":"Give Serra and Beza some pieces so their towers have the same height.  \nYou have N types of pieces, each with length L_i.  \nYou can give any number of each type to each person (up to 10^9 per type).  \nOutput how many of each piece type to give to Serra and to Beza.","has_page_source":false}