{"problem":{"name":"Contrast","description":{"content":"Given are two sequences $A$ and $B$, both of length $N$. $A$ and $B$ are each sorted in the ascending order. Check if it is possible to reorder the terms of $B$ so that for each $i$ ($1 \\leq i \\leq N$","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc178_f"},"statements":[{"statement_type":"Markdown","content":"Given are two sequences $A$ and $B$, both of length $N$. $A$ and $B$ are each sorted in the ascending order. Check if it is possible to reorder the terms of $B$ so that for each $i$ ($1 \\leq i \\leq N$) $A_i \\neq B_i$ holds, and if it is possible, output any of the reorderings that achieve it.\n\n## Constraints\n\n*   $1\\leq N \\leq 2 \\times 10^5$\n*   $1\\leq A_i,B_i \\leq N$\n*   $A$ and $B$ are each sorted in the ascending order.\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n$B_1$ $B_2$ $\\cdots$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc178_f","tags":[],"sample_group":[["6\n1 1 1 2 2 3\n1 1 1 2 2 3","Yes\n2 2 3 1 1 1"],["3\n1 1 2\n1 1 3","No"],["4\n1 1 2 3\n1 2 3 3","Yes\n3 3 1 2"]],"created_at":"2026-03-03 11:01:14"}}