{"problem":{"name":"Box in Box","description":{"content":"There are $N$ boxes. The $i$\\-th box has a shape of a rectangular cuboid whose height, width, and depth are $h_i,w_i$, and $d_i$, respectively. Determine if there are two boxes such that one's height,","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2500,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc309_f"},"statements":[{"statement_type":"Markdown","content":"There are $N$ boxes. The $i$\\-th box has a shape of a rectangular cuboid whose height, width, and depth are $h_i,w_i$, and $d_i$, respectively.\nDetermine if there are two boxes such that one's height, width, and depth are strictly greater than those of the other after rotating them if necessary.\n\n## Constraints\n\n*   $2 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq h_i,w_i,d_i \\leq 10^9$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$h_1$ $w_1$ $d_1$\n$\\vdots$\n$h_N$ $w_N$ $d_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc309_f","tags":[],"sample_group":[["3\n19 8 22\n10 24 12\n15 25 11","Yes\n\nIf you rotate the $2$\\-nd box to swap its height and depth, the $3$\\-rd box will have greater height, depth, and width."],["3\n19 8 22\n10 25 12\n15 24 11","No"],["2\n1 1 2\n1 2 2","No"]],"created_at":"2026-03-03 11:01:14"}}