{"problem":{"name":"Three Cards","description":{"content":"There are $N$ cards, numbered $1$ to $N$. Card $i$ has a positive integer $A_i$ written on it. You can choose three of these cards and concatenate the integers written on them in any order you like to","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc146_a"},"statements":[{"statement_type":"Markdown","content":"There are $N$ cards, numbered $1$ to $N$.\nCard $i$ has a positive integer $A_i$ written on it.\nYou can choose three of these cards and concatenate the integers written on them in any order you like to make a new integer. For example, if you choose cards with $1$, $23$, and $4$ written on them, you can make integers such as $1234$ and $4231$.\nFind the maximum integer you can make.\n\n## Constraints\n\n*   $3 \\le N \\le 2 \\times 10^5$\n*   $1 \\le A_i < 10^6$\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$ $\\dots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc146_a","tags":[],"sample_group":[["5\n1 4 3 5 8","854\n\nIf you choose cards with $4$, $5$, and $8$ written on them, you can make $458$, $485$, $548$, $584$, $845$, or $854$.\nYou can make nothing greater than $854$, so the answer is $854$."],["8\n813 921 481 282 120 900 555 409","921900813"]],"created_at":"2026-03-03 11:01:14"}}