#include <iostream>
#include <fstream>
using namespace std;
ifstream fin(“bac.in”);
int a10001,b10001,m,n,i,j,ok=0;
int main()
{
fin>>m>>n;
for(i=1; i<=m; i++)
{
fin>>a[i];
if(a[i]%2==0)ok=1;
}
for(i=1; i<=n; i++)
{
fin>>b[i];
ok=1;
}
if(ok==1)
{
i=m;
j=n;
while(i>=1&&j>=1)
{
while(b[j]%2!=0)
j—;
while(a[i]%2!=0)
i—;
if(b[j]>a[i])
{
cout<<b[j]<<’ ‘;
j—;
}
else if(b[j]==a[i])
{
cout<<b[j]<<’ ‘;
j—;
i—;
}
else
{
cout<<a[i]<<’ ‘;
i—;
}
}
while(i>=1)
{
if(a[i]%2==0)
cout<<a[i]<<’ ‘;
i—;
}
else cout<<“nu exista”; return 0; }