{"raw_statement":[{"iden":"statement","content":"You are given a sequence _a_1, _a_2, ..., _a__n_ of one-dimensional segments numbered 1 through _n_. Your task is to find two distinct indices _i_ and _j_ such that segment _a__i_ lies within segment _a__j_.\n\nSegment \\[_l_1, _r_1\\] lies within segment \\[_l_2, _r_2\\] iff _l_1 ≥ _l_2 and _r_1 ≤ _r_2.\n\nPrint indices _i_ and _j_. If there are multiple answers, print any of them. If no answer exists, print _\\-1 -1_."},{"iden":"input","content":"The first line contains one integer _n_ (1 ≤ _n_ ≤ 3·105) — the number of segments.\n\nEach of the next _n_ lines contains two integers _l__i_ and _r__i_ (1 ≤ _l__i_ ≤ _r__i_ ≤ 109) — the _i_\\-th segment."},{"iden":"output","content":"Print two distinct indices _i_ and _j_ such that segment _a__i_ lies within segment _a__j_. If there are multiple answers, print any of them. If no answer exists, print _\\-1 -1_."},{"iden":"examples","content":"Input\n\n5\n1 10\n2 9\n3 9\n2 3\n2 9\n\nOutput\n\n2 1\n\nInput\n\n3\n1 5\n2 6\n6 20\n\nOutput\n\n\\-1 -1"},{"iden":"note","content":"In the first example the following pairs are considered correct:\n\n*   (2, 1), (3, 1), (4, 1), (5, 1) — not even touching borders;\n*   (3, 2), (4, 2), (3, 5), (4, 5) — touch one border;\n*   (5, 2), (2, 5) — match exactly."}],"translated_statement":[{"iden":"statement","content":"你被给定一个一维线段序列 #cf_span[a1, a2, ..., an]，编号从 #cf_span[1] 到 #cf_span[n]。你的任务是找到两个不同的索引 #cf_span[i] 和 #cf_span[j]，使得线段 #cf_span[ai] 包含于线段 #cf_span[aj] 中。\n\n线段 #cf_span[[l1, r1]] 包含于线段 #cf_span[[l2, r2]] 当且仅当 #cf_span[l1 ≥ l2] 且 #cf_span[r1 ≤ r2]。\n\n请输出索引 #cf_span[i] 和 #cf_span[j]。如果存在多个答案，输出任意一个即可。如果无解，请输出 _-1 -1_。\n\n第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 3·105]) —— 线段的数量。\n\n接下来的 #cf_span[n] 行每行包含两个整数 #cf_span[li] 和 #cf_span[ri] (#cf_span[1 ≤ li ≤ ri ≤ 109]) —— 第 #cf_span[i] 个线段。"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 3·105]) —— 线段的数量。接下来的 #cf_span[n] 行每行包含两个整数 #cf_span[li] 和 #cf_span[ri] (#cf_span[1 ≤ li ≤ ri ≤ 109]) —— 第 #cf_span[i] 个线段。"},{"iden":"output","content":"请输出两个不同的索引 #cf_span[i] 和 #cf_span[j]，使得线段 #cf_span[ai] 包含于线段 #cf_span[aj] 中。如果存在多个答案，输出任意一个即可。如果无解，请输出 _-1 -1_。"},{"iden":"examples","content":"输入\n5\n1 10\n2 9\n3 9\n2 3\n2 9\n输出\n2 1\n\n输入\n3\n1 5\n2 6\n6 20\n输出\n-1 -1"},{"iden":"note","content":"在第一个例子中，以下配对均被视为正确：\n#cf_span[(2, 1), (3, 1), (4, 1), (5, 1)] —— 甚至不接触边界；\n#cf_span[(3, 2), (4, 2), (3, 5), (4, 5)] —— 接触一个边界；\n#cf_span[(5, 2), (2, 5)] —— 完全重合。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of segments.  \nLet $ S = \\{(l_i, r_i, i) \\mid i \\in \\{1, \\dots, n\\}\\} $ be the set of segments, where each segment is represented by its left endpoint $ l_i $, right endpoint $ r_i $, and its 1-based index $ i $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 3 \\cdot 10^5 $  \n2. For each $ i \\in \\{1, \\dots, n\\} $: $ 1 \\leq l_i \\leq r_i \\leq 10^9 $\n\n**Objective**  \nFind two distinct indices $ i, j \\in \\{1, \\dots, n\\} $, $ i \\ne j $, such that:  \n$$\nl_i \\geq l_j \\quad \\text{and} \\quad r_i \\leq r_j\n$$  \nIf such a pair exists, output $ (i, j) $.  \nIf no such pair exists, output $ (-1, -1) $.","simple_statement":null,"has_page_source":false}