{"problem":{"name":"C. A Mist of Florescence","description":{"content":"%epigraph%%epigraphtext% _As the boat drifts down the river, a wood full of blossoms shows up on the riverfront.\"I've been here once,\" Mino exclaims with delight, \"it's breathtakingly amazing.\" \"What","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF989C"},"statements":[{"statement_type":"Markdown","content":"%epigraph%%epigraphtext% _As the boat drifts down the river, a wood full of blossoms shows up on the riverfront.\"I've been here once,\" Mino exclaims with delight, \"it's breathtakingly amazing.\"\n\n\"What is it like?\"\n\n\"Look, Kanno, you've got your paintbrush, and I've got my words. Have a try, shall we?\"_%endepigraphtext%%endepigraph%There are four kinds of flowers in the wood, Amaranths, Begonias, Centaureas and Dianthuses.\n\nThe wood can be represented by a rectangular grid of $n$ rows and $m$ columns. In each cell of the grid, there is exactly one type of flowers.\n\nAccording to Mino, the numbers of connected components formed by each kind of flowers are $a$, $b$, $c$ and $d$ respectively. Two cells are considered in the same connected component if and only if a path exists between them that moves between cells sharing common edges and passes only through cells containing the same flowers.\n\nYou are to help Kanno depict such a grid of flowers, with $n$ and $m$ arbitrarily chosen under the constraints given below. It can be shown that at least one solution exists under the constraints of this problem.\n\nNote that you can choose arbitrary $n$ and $m$ under the constraints below, they are not given in the input.\n\n## Input\n\nThe first and only line of input contains four space-separated integers $a$, $b$, $c$ and $d$ ($1 \\leq a, b, c, d \\leq 100$) — the required number of connected components of Amaranths, Begonias, Centaureas and Dianthuses, respectively.\n\n## Output\n\nIn the first line, output two space-separated integers $n$ and $m$ ($1 \\leq n, m \\leq 50$) — the number of rows and the number of columns in the grid respectively.\n\nThen output $n$ lines each consisting of $m$ consecutive English letters, representing one row of the grid. Each letter should be among '_A_', '_B_', '_C_' and '_D_', representing Amaranths, Begonias, Centaureas and Dianthuses, respectively.\n\nIn case there are multiple solutions, print any. You can output each letter in either case (upper or lower).\n\n[samples]\n\n## Note\n\nIn the first example, each cell of Amaranths, Begonias and Centaureas forms a connected component, while all the Dianthuses form one.\n\n<center>![image](https://espresso.codeforces.com/ad1444251896ce5c002696bb2dbad8c807536ee5.png)</center>","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"\"我来过这里一次，\"米诺欣喜地喊道，\"真是太令人惊叹了。\"\n\n\"它是什么样子的？\"\n\n\"看，卡诺，你有你的画笔，我有我的文字。来试试吧？\"\n\n森林中有四种花：千日红、秋海棠、矢车菊和石竹。\n\n这片森林可以用一个包含 $n$ 行 $m$ 列的矩形网格表示。网格中的每个单元格恰好包含一种花。\n\n根据米诺的说法，每种花形成的连通分量数量分别为 $a$、$b$、$c$ 和 $d$。两个单元格属于同一个连通分量，当且仅当存在一条路径连接它们，该路径只能在共享公共边且包含相同花朵的单元格之间移动。\n\n你需要帮助卡诺绘制出这样的花格，其中 $n$ 和 $m$ 可以在以下约束条件下任意选择。可以证明，在本题的约束条件下至少存在一个解。\n\n请注意，你可以根据以下约束任意选择 $n$ 和 $m$，它们不会在输入中给出。\n\n输入的第一行（也是唯一一行）包含四个用空格分隔的整数 $a$、$b$、$c$ 和 $d$（$1 lt.eq a, b, c, d lt.eq 100$）—— 分别表示千日红、秋海棠、矢车菊和石竹所需的连通分量数量。\n\n第一行输出两个用空格分隔的整数 $n$ 和 $m$（$1 lt.eq n, m lt.eq 50$）—— 分别表示网格的行数和列数。\n\n然后输出 $n$ 行，每行包含 $m$ 个连续的英文字母，表示网格的一行。每个字母应为 '_A_'、'_B_'、'_C_' 或 '_D_' 之一，分别代表千日红、秋海棠、矢车菊和石竹。\n\n如果有多个解，输出任意一个即可。你可以使用任意大小写输出每个字母。\n\n在第一个例子中，每种千日红、秋海棠和矢车菊的单元格各自形成一个连通分量，而所有石竹形成一个连通分量。\n\n## Input\n\n输入的第一行（也是唯一一行）包含四个用空格分隔的整数 $a$、$b$、$c$ 和 $d$（$1 lt.eq a, b, c, d lt.eq 100$）—— 分别表示千日红、秋海棠、矢车菊和石竹所需的连通分量数量。\n\n## Output\n\n第一行输出两个用空格分隔的整数 $n$ 和 $m$（$1 lt.eq n, m lt.eq 50$）—— 分别表示网格的行数和列数。然后输出 $n$ 行，每行包含 $m$ 个连续的英文字母，表示网格的一行。每个字母应为 '_A_'、'_B_'、'_C_' 或 '_D_' 之一，分别代表千日红、秋海棠、矢车菊和石竹。如果有多个解，输出任意一个即可。你可以使用任意大小写输出每个字母。\n\n[samples]\n\n## Note\n\n在第一个例子中，每种千日红、秋海棠和矢车菊的单元格各自形成一个连通分量，而所有石竹形成一个连通分量。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ a, b, c, d \\in \\mathbb{Z}^+ $ be the required numbers of connected components for flowers A, B, C, D respectively, with $ 1 \\leq a, b, c, d \\leq 100 $.\n\n**Constraints**  \nConstruct a grid of size $ n \\times m $, where $ 1 \\leq n, m \\leq 50 $, such that:  \n- Each cell is labeled with one of {A, B, C, D}.  \n- The number of 4-connected components of A is exactly $ a $.  \n- The number of 4-connected components of B is exactly $ b $.  \n- The number of 4-connected components of C is exactly $ c $.  \n- The number of 4-connected components of D is exactly $ d $.  \n\n**Objective**  \nOutput any valid grid configuration satisfying the above.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF989C","tags":["constructive algorithms","graphs"],"sample_group":[["5 3 2 1","4 7\nDDDDDDD\nDABACAD\nDBABACD\nDDDDDDD"],["50 50 1 1","4 50\nCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\nABABABABABABABABABABABABABABABABABABABABABABABABAB\nBABABABABABABABABABABABABABABABABABABABABABABABABA\nDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"],["1 6 4 5","7 7\nDDDDDDD\nDDDBDBD\nDDCDCDD\nDBDADBD\nDDCDCDD\nDBDBDDD\nDDDDDDD"]],"created_at":"2026-03-03 11:00:39"}}