#include<iostream.h> int a[10],n,b[10],m,c[20],p; void main() { int i,j,k; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; cin>>m; for(i=1;i<=m;i++) cin>>b[i]; i=j=k=1; while(i<=n && j<=m) if(a[i]<b[j]) c[k++]=a[i++]; else c[k++]=b[j++]; while(i<=n) c[k++]=a[i++]; while(j<=m) c[k++]=b[j++]; for(i=1;i<=n+m;i++) cout<<c[i]<<" "; }