{"problem":{"name":"Qualification Contest","description":{"content":"There were $N$ participants in a contest. The participant ranked $i$\\-th had the nickname $S_i$.   Print the nicknames of the top $K$ participants in **lexicographical order**. What is lexicographical","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc288_b"},"statements":[{"statement_type":"Markdown","content":"There were $N$ participants in a contest. The participant ranked $i$\\-th had the nickname $S_i$.  \nPrint the nicknames of the top $K$ participants in **lexicographical order**.\nWhat is lexicographical order?Simply put, the lexicographical order is the order of words in a dictionary. As a formal description, below is an algorithm to order distinct strings $S$ and $T$.\nLet $S_i$ denote the $i$\\-th character of a string $S$. We write $S \\lt T$ if $S$ is lexicographically smaller than $T$, and $S \\gt T$ if $S$ is larger.\n\n1.  Let $L$ be the length of the shorter of $S$ and $T$. For $i=1,2,\\dots,L$, check whether $S_i$ equals $T_i$.\n2.  If there is an $i$ such that $S_i \\neq T_i$, let $j$ be the smallest such $i$. Compare $S_j$ and $T_j$. If $S_j$ is alphabetically smaller than $T_j$, we get $S \\lt T$; if $S_j$ is larger, we get $S \\gt T$.\n3.  If there is no $i$ such that $S_i \\neq T_i$, compare the lengths of $S$ and $T$. If $S$ is shorter than $T$, we get $S \\lt T$; if $S$ is longer, we get $S \\gt T$.\n\n## Constraints\n\n*   $1 \\leq K \\leq N \\leq 100$\n*   $K$ and $N$ are integers.\n*   $S_i$ is a string of length $10$ consisting of lowercase English letters.\n*   $S_i \\neq S_j$ if $i \\neq j$.\n\n## Input\n\nThe input 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":"abc288_b","tags":[],"sample_group":[["5 3\nabc\naaaaa\nxyz\na\ndef","aaaaa\nabc\nxyz\n\nThis contest had five participants. The participants ranked first, second, third, fourth, and fifth had the nicknames `abc`, `aaaaa`, `xyz`, `a`, and `def`, respectively.\nThe nicknames of the top three participants were `abc`, `aaaaa`, `xyz`, so print these in lexicographical order: `aaaaa`, `abc`, `xyz`."],["4 4\nz\nzyx\nzzz\nrbg","rbg\nz\nzyx\nzzz"],["3 1\nabc\narc\nagc","abc"]],"created_at":"2026-03-03 11:01:14"}}