#include<iostream.h>
void main()
{
int a[3]={1,3,5};
int b[3]={2,4,6};
int c[6];
int i,j,k=0;
for(i=0,j=0;i<3&&j<3;)
{
if(a[i]>b[j])
c[k++]=b[j++];
else
c[k++]=a[i++];
}
if(i==3)
{
for(;j<3;j++)
c[k++]=b[j];
}
else
{
for(;i<3;i++)
c[k++]=a[i];
}
for(i=0;i<k;i++)
cout<<c[i]<<" ";
}