```#include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
int main()
{
int n,m;
string a,b;
cin>>n>>m;
cin>>a>>b;
sort(b.begin(),b.end(),greater[HTML_REMOVED]());
int j=0;
for(int i=0;a[i];i)
{
if(a[i]<b[j])
{
a[i]=b[j];
j;
}
}
cout<<a<<endl;
cout<<a.rbegin();
string::reverse_iterator f=a.rbegin();
cout<<’ ‘<<f;
}
```