#P9539. 「AWOI Round 2 B」树学

「AWOI Round 2 B」树学

Background

HR has just finished a simple and pretty problem, and it wants to try this one. But it is too weak and cannot solve it. Can you help it?

Problem Description

Construct a lowercase letter string of length nn, such that its similarity with the given lowercase letter string ss of length nn is within the range [l,r][l,r].

Define the similarity of two strings a,ba,b of length nn as i=1n[ai=bi]\sum^{n}_{i=1}[a_i=b_i].

You need to make the constructed string as small as possible in lexicographical order.

Input Format

The first line contains three positive integers n,l,rn,l,r.

The next line contains a string, representing the given lowercase letter string ss.

Output Format

Output one line containing a string, representing the lexicographically smallest feasible string you construct.

3 1 2
aab
aaa
4 4 4
awoi

awoi

Hint

Constraints

This problem uses bundled tests.

Subtask ID nn\leqslant Special Property Score
11 100100 None 2020
22 10610^6 A 1010
33 B
44 None 6060

Special Property A: l=r=nl=r=n or l=0,r=nl=0,r=n.

Special Property B: Every character of ss is a, or every character is not a.

For 100%100\% of the testdata, 1n1061 \leqslant n \leqslant 10^6, 0lrn0 \leqslant l \leqslant r \leqslant n, and the length of ss is nn.

Staff | Idea\text{Idea} | Data\text{Data} | Check\text{Check} | Solution\text{Solution} | | :----------: | :----------: | :----------: | :----------: | | 玄学OIER荷蒻 | QwQ666_666 & 玄学OIER荷蒻 | QwQ666_666| 玄学OIER荷蒻 |

Translated by ChatGPT 5