{"problem":{"name":"String Cards","description":{"content":"We have $N$ cards. The $i$\\-th card has a string $S_i$ written on it. Find the lexicographically smallest string that can be obtained by choosing $K$ of these cards and concatenating them in any order","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc225_f"},"statements":[{"statement_type":"Markdown","content":"We have $N$ cards. The $i$\\-th card has a string $S_i$ written on it.\nFind the lexicographically smallest string that can be obtained by choosing $K$ of these cards and concatenating them in any order.\n\n## Constraints\n\n*   $1 \\leq K \\leq N \\leq 50$\n*   $1 \\leq |S_i| \\leq 50$\n*   $S_i$ consists of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n$S_1$\n$S_2$\n$\\vdots$\n$S_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc225_f","tags":[],"sample_group":[["4 3\node\nzaaa\nr\natc","atcoder\n\nNote that it is not possible to reverse or permute the string written on a card.  \nFor example, `ode` written on the first card cannot be used as `edo` or `deo`."],["5 2\nz\nz\nzzz\nz\nzzzzzz","zz\n\nThere may be a pair $i, j$ $(i\\neq j)$ such that $S_i = S_j$."]],"created_at":"2026-03-03 11:01:13"}}