#P10836. 『FLA - I』歌静河
『FLA - I』歌静河
Description
Qiu has two strings of length that only contain # and lowercase letters.
These two strings contain #s in total. Qiu intends to perform operations to replace all #s in the two strings with lowercase letters. For the -th operation, he has to choose a string from and replace the first # in this string from left to right with the -th lowercase letter. He cannot choose a string that does not contain #.
Qiu has a friend who loves art. He wants to minimize the lexicographic order of the string after performing operations. Qiu thought that programming is also a kind of art, and in this way, their hearts will be closer.
Input Format
The first line contains two positive integers .
The second line contains a string of length .
The last line contains a string of length .
Output Format
Output one line of one string, indicating the minimum in lexicographic order that can be obtained after executing operations.
8 2
th#nkyou
#estwish
thankyou
16 5
##soluteradian#e
your#awnwillcom#
absoluteradiance
40 45
hhuj#pzr#k#mmd#z##y#o####m##j##tga#k#t#g
m########be#######vf##a#j###ypuf###pr###
hhujapzrakbmmdczdeyfoghijmkljmntgaokptqg
Hint
「Sample Explanation #1」
In the first operation, Qiu selects the string and replaces the # into with the -st lowercase letter, i.e. a; In the second operation, Qiu selects the string and replaces the # in with the -nd lowercase letter, i.e. b. The final string is thankyou, which can be proved to be the smallest in lexicographic order after executing operations.
「Constraints」
| Test Id | Special Property | |
|---|---|---|
| No | ||
| Yes | ||
| No |
- Special Property: It is guaranteed that there is a string in that does not contain
#.
Each test is worth points.
For all tests, , , the string contains only the character # and lowercase letters.
京公网安备 11011102002149号