409358: GYM103488 L Lexicographic Order

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

L. Lexicographic Ordertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Nana7mi has a string $$$s$$$ with length of $$$n$$$ and containing only lowercase characters.

Now she wants to know the lexicographically greatest string $$$t$$$ with length not exceed $$$m$$$, containing only lowercase characters and is lexicographically less than $$$s$$$.

String $$$x$$$ is lexicographically less than string $$$y$$$, if either $$$x$$$ is a prefix of $$$y$$$ (and $$$x \neq y$$$), or there exists such $$$i (1 \le i \le min(|x|,|y|)$$$), that $$$x_i < y_i$$$, and for any $$$j (1 \le j < i) x_j = y_j$$$. Here $$$|a|$$$ denotes the length of the string $$$a$$$.

Input

The first line of input contains two integers $$$n,m(2 \le n \le m \le 10^6)$$$ — the length of $$$s$$$ and the length limit of $$$t$$$.

The second line contains a string $$$s$$$ with length of $$$n$$$, as the string Nana7mi has.

Output

Output a string with length not exceed $$$m$$$ and containing only lowercase characters in a line.

ExampleInput
3 4
ybb
Output
ybaz

加入题单

上一题 下一题 算法标签: