{"raw_statement":[{"iden":"statement","content":"Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya's idea and wants to present him a rectangular parallelepiped of marble from which he can carve the sphere.\n\nZahar has _n_ stones which are rectangular parallelepipeds. The edges sizes of the _i_\\-th of them are _a__i_, _b__i_ and _c__i_. He can take **no more than two stones** and present them to Kostya.\n\nIf Zahar takes two stones, he should glue them together on one of the faces in order to get a new piece of rectangular parallelepiped of marble. Thus, it is possible to glue a pair of stones together if and only if two faces on which they are glued together match as rectangles. In such gluing it is allowed to rotate and flip the stones in any way.\n\nHelp Zahar choose such a present so that Kostya can carve a sphere of the maximum possible volume and present it to Zahar."},{"iden":"input","content":"The first line contains the integer _n_ (1 ≤ _n_ ≤ 105).\n\n_n_ lines follow, in the _i_\\-th of which there are three integers _a__i_, _b__i_ and _c__i_ (1 ≤ _a__i_, _b__i_, _c__i_ ≤ 109) — the lengths of edges of the _i_\\-th stone. Note, that two stones may have exactly the same sizes, but they still will be considered two different stones."},{"iden":"output","content":"In the first line print _k_ (1 ≤ _k_ ≤ 2) the number of stones which Zahar has chosen. In the second line print _k_ distinct integers from 1 to _n_ — the numbers of stones which Zahar needs to choose. Consider that stones are numbered from 1 to _n_ in the order as they are given in the input data.\n\nYou can print the stones in arbitrary order. If there are several answers print any of them."},{"iden":"examples","content":"Input\n\n6\n5 5 5\n3 2 4\n1 4 1\n2 1 3\n3 2 4\n3 3 4\n\nOutput\n\n1\n1\n\nInput\n\n7\n10 7 8\n5 10 3\n4 2 6\n5 5 5\n10 2 8\n4 2 1\n7 7 7\n\nOutput\n\n2\n1 5"},{"iden":"note","content":"In the first example we can connect the pairs of stones:\n\n*   2 and 4, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1\n*   2 and 5, the size of the parallelepiped: 3 × 2 × 8 or 6 × 2 × 4 or 3 × 4 × 4, the radius of the inscribed sphere 1, or 1, or 1.5 respectively.\n*   2 and 6, the size of the parallelepiped: 3 × 5 × 4, the radius of the inscribed sphere 1.5\n*   4 and 5, the size of the parallelepiped: 3 × 2 × 5, the radius of the inscribed sphere 1\n*   5 and 6, the size of the parallelepiped: 3 × 4 × 5, the radius of the inscribed sphere 1.5\n\nOr take only one stone:\n\n*   **1 the size of the parallelepiped: 5 × 5 × 5, the radius of the inscribed sphere 2.5**\n*   2 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1\n*   3 the size of the parallelepiped: 1 × 4 × 1, the radius of the inscribed sphere 0.5\n*   4 the size of the parallelepiped: 2 × 1 × 3, the radius of the inscribed sphere 0.5\n*   5 the size of the parallelepiped: 3 × 2 × 4, the radius of the inscribed sphere 1\n*   6 the size of the parallelepiped: 3 × 3 × 4, the radius of the inscribed sphere 1.5\n\nIt is most profitable to take only the first stone."}],"translated_statement":"[{\"iden\":\"statement\",\"content\":\"Kostya 是一位才华横溢的雕塑家，他有一个想法：雕刻一个球形的大理石雕塑。Kostya 有一位朋友 Zahar，他在采石场工作。Zahar 知道 Kostya 的想法，想送给他一个长方体大理石块，以便从中雕刻出球体。\\n\\nZahar 有 #cf_span[n] 块大理石，每块都是长方体。第 #cf_span[i] 块的边长分别为 #cf_span[ai]、#cf_span[bi] 和 #cf_span[ci]。他最多可以选取两块石头送给 Kostya。\\n\\n如果 Zahar 选取两块石头，他必须将它们沿一个面粘合在一起，以形成一个新的长方体大理石块。因此，只有当两个要粘合的面是全等的矩形时，才能将两块石头粘合。在粘合过程中，允许对石头进行任意旋转或翻转。\\n\\n请帮助 Zahar 选择一个礼物，使得 Kostya 能够雕刻出体积尽可能大的球体，并将它送给 Zahar。\\n\\n第一行包含整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 105]）。\\n\\n接下来 #cf_span[n] 行，每行包含三个整数 #cf_span[ai, bi] 和 #cf_span[ci]（#cf_span[1 ≤ ai, bi, ci ≤ 109]）——表示第 #cf_span[i] 块石头的边长。注意，即使两块石头的尺寸完全相同，它们仍被视为两个不同的石头。\\n\\n第一行输出 #cf_span[k]（#cf_span[1 ≤ k ≤ 2]），表示 Zahar 选择的石头数量。第二行输出 #cf_span[k] 个互不相同的整数，范围从 #cf_span[1] 到 #cf_span[n]——表示 Zahar 需要选择的石头编号。石头编号按输入顺序从 #cf_span[1] 到 #cf_span[n] 给出。\\n\\n你可以按任意顺序输出石头编号。如果有多个答案，输出任意一个即可。 \\n\\n在第一个例子中，我们可以连接以下石头对：\\n\\n或者只取一块石头：\\n\\n最有利的选择是仅取第一块石头。 \"},{\"iden\":\"input\",\"content\":\"第一行包含整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 105]）。#cf_span[n] 行随后出现，第 #cf_span[i] 行包含三个整数 #cf_span[ai, bi] 和 #cf_span[ci]（#cf_span[1 ≤ ai, bi, ci ≤ 109]）——表示第 #cf_span[i] 块石头的边长。注意，即使两块石头的尺寸完全相同，它们仍被视为两个不同的石头。\"},{\"iden\":\"output\",\"content\":\"第一行输出 #cf_span[k]（#cf_span[1 ≤ k ≤ 2]），表示 Zahar 选择的石头数量。第二行输出 #cf_span[k] 个互不相同的整数，范围从 #cf_span[1] 到 #cf_span[n]——表示 Zahar 需要选择的石头编号。石头编号按输入顺序从 #cf_span[1] 到 #cf_span[n] 给出。你可以按任意顺序输出石头编号。如果有多个答案，输出任意一个即可。 \"},{\"iden\":\"examples\",\"content\":\"输入\\n6\\n5 5 5\\n3 2 4\\n1 4 1\\n2 1 3\\n3 2 4\\n3 3 4\\n输出\\n1\\n1\\n\\n输入\\n7\\n10 7 8\\n5 10 3\\n4 2 6\\n5 5 5\\n10 2 8\\n4 2 1\\n7 7 7\\n输出\\n2\\n1 5\"},{\"iden\":\"note\",\"content\":\"在第一个例子中，我们可以连接以下石头对：\\n\\n#cf_span[2] 和 #cf_span[4]，长方体尺寸为 #cf_span[3 × 2 × 5]，内切球半径为 #cf_span[1]；\\n#cf_span[2] 和 #cf_span[5]，长方体尺寸为 #cf_span[3 × 2 × 8] 或 #cf_span[6 × 2 × 4] 或 #cf_span[3 × 4 × 4]，内切球半径分别为 #cf_span[1]、#cf_span[1] 或 #cf_span[1.5]；\\n#cf_span[2] 和 #cf_span[6]，长方体尺寸为 #cf_span[3 × 5 × 4]，内切球半径为 #cf_span[1.5]；\\n#cf_span[4] 和 #cf_span[5]，长方体尺寸为 #cf_span[3 × 2 × 5]，内切球半径为 #cf_span[1]；\\n#cf_span[5] 和 #cf_span[6]，长方体尺寸为 #cf_span[3 × 4 × 5]，内切球半径为 #cf_span[1.5]。\\n\\n或者只取一块石头：\\n\\n*#cf_span[1]，长方体尺寸为 #cf_span[5 × 5 × 5]，内切球半径为 #cf_span[2.5]*；\\n#cf_span[2]，长方体尺寸为 #cf_span[3 × 2 × 4]，内切球半径为 #cf_span[1]；\\n#cf_span[3]，长方体尺寸为 #cf_span[1 × 4 × 1]，内切球半径为 #cf_span[0.5]；\\n#cf_span[4]，长方体尺寸为 #cf_span[2 × 1 × 3]，内切球半径为 #cf_span[0.5]；\\n#cf_span[5]，长方体尺寸为 #cf_span[3 × 2 × 4]，内切球半径为 #cf_span[1]；\\n#cf_span[6]，长方体尺寸为 #cf_span[3 × 3 × 4]，内切球半径为 #cf_span[1.5]。\\n\\n最有利的选择是仅取第一块石头。 \"}]}","sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of stones.  \nFor each $ i \\in \\{1, \\dots, n\\} $, let $ S_i = (a_i, b_i, c_i) \\in \\mathbb{R}^3_+ $ denote the edge lengths of the $ i $-th rectangular parallelepiped stone.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10^5 $  \n2. $ 1 \\leq a_i, b_i, c_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $  \n3. Zahar may select either one stone or two distinct stones.  \n4. If two stones $ i $ and $ j $ are selected, they must be glueable: there exist face rectangles of $ S_i $ and $ S_j $ that are congruent (i.e., same multiset of side lengths, disregarding order).  \n5. Gluing is performed by identifying two congruent rectangular faces; the resulting solid is a rectangular parallelepiped with dimensions formed by combining the non-glued dimensions.\n\n**Objective**  \nSelect a subset $ \\mathcal{I} \\subseteq \\{1, \\dots, n\\} $ with $ |\\mathcal{I}| \\in \\{1, 2\\} $ such that the maximum possible diameter of a sphere that can be carved from the resulting parallelepiped is maximized.  \n\nThe diameter of the largest sphere that fits in a rectangular parallelepiped with dimensions $ (x, y, z) $ is $ \\min(x, y, z) $.  \n\nFor a single stone $ i $, the sphere diameter is $ d_i = \\min(a_i, b_i, c_i) $.  \n\nFor two glued stones $ i $ and $ j $, let $ F_i $ and $ F_j $ be matching faces (i.e., rectangles of equal side lengths, up to permutation). After gluing, the resulting parallelepiped has dimensions:  \n- The two dimensions from the non-glued axes of each stone,  \n- The sum of the dimensions along the glued axis.  \n\nMore precisely:  \nLet $ S_i $ have sorted dimensions $ (x_i \\leq y_i \\leq z_i) $, and $ S_j $ have sorted dimensions $ (x_j \\leq y_j \\leq z_j) $.  \nGluing is possible only if two of the three face types match:  \n- If glued on $ (x_i, y_i) = (x_j, y_j) $, then result: $ (x_i, y_i, z_i + z_j) $ → diameter = $ \\min(x_i, y_i, z_i + z_j) $  \n- If glued on $ (x_i, z_i) = (x_j, z_j) $, then result: $ (x_i, z_i, y_i + y_j) $ → diameter = $ \\min(x_i, z_i, y_i + y_j) $  \n- If glued on $ (y_i, z_i) = (y_j, z_j) $, then result: $ (y_i, z_i, x_i + x_j) $ → diameter = $ \\min(y_i, z_i, x_i + x_j) $  \n\nLet $ d_{\\text{glue}}(i,j) $ be the maximum possible sphere diameter obtainable by gluing $ i $ and $ j $ over all valid face matchings.  \n\n**Goal**:  \nFind $ \\mathcal{I} \\subseteq \\{1, \\dots, n\\} $, $ |\\mathcal{I}| \\in \\{1,2\\} $, maximizing:  \n$$\n\\max\\left( \\max_{i=1}^n d_i,\\ \\max_{\\substack{i,j=1 \\\\ i \\ne j}}^n d_{\\text{glue}}(i,j) \\right)\n$$  \nOutput $ |\\mathcal{I}| $ and the indices in $ \\mathcal{I} $.","simple_statement":null,"has_page_source":false}