var

mas1,mas2,v:array[1..1000] of integer;
razmerMas,k,i,l,r:integer;



procedure qSort(l,r:longint);
var i,j:longint;
    w,q:integer;
begin
  i := l; j := r;
  q := v[(l+r) div 2];
  repeat
    while (v[i] < q) do inc(i);
    while (q < v[j]) do dec(j);
    if (i <= j) then
    begin
      w:=v[i]; v[i]:=v[j]; v[j]:=w;
      inc(i); dec(j);
    end;
  until (i > j);
  if (l < j) then qSort(l,j);
  if (i < r) then qSort(i,r);
end;

begin
	read(razmerMas);
	for i:=1 to razmerMas do
	begin
		read(mas1[i]);
		v[i]:=mas1[i];
	end;
	
	for i:=1 to razmerMas do
		read(mas2[i]);

	qSort(1,razmerMas);
	for i:=1 to razmerMas do
	begin
		mas1[i]:=v[i];
		v[i]:=mas2[i];
	end;

	qsort(1,razmerMas);
	for i:=1 to razmerMas do
		mas2[i]:=v[i];
	i:=0;
	l:=1; r:=1;

	while (l<=razmerMas) or(r<=razmerMas) do
		begin
		i:=i+1;
			if l>razmerMas then
			begin
				v[i]:=mas2[r]; r:=r+1; continue;
			end;

			if r>razmerMas then
			begin
				v[i]:=mas1[l]; l:=l+1; continue;
			end;

			if (mas1[l]<mas2[r]) then
			begin
				 v[i]:=mas1[l];
				l:=l+1;
			end else
			begin
				 v[i]:=mas2[r];
				r:=r+1;
			end;

		end;
	for i:=1 to 2*razmerMas do
		write(v[i],' ');

end.
