program malls;
const MAX=100000;
type elenco = array[0..Max-1] of qword;
var N, i :longint;
    D : elenco;
    K, maxdist, pos : qword;
    diff : array[0..MAX] of qword;
    
procedure scambia (var x,y: qword);
var t:qword;
begin
   t:=x;
   x:=y;
   y:=t;
end;  
Procedure ordinamento (estremoi,estremos: qword; var v : elenco; ordinato:boolean);
var inf, sup, medio:qword;
    pivot : qword;
begin
    inf:=estremoi;
    sup:=estremos;
    medio:= (estremoi+estremos) div 2;
    pivot:=v[medio];
    repeat
      if (ordinato) then
         begin
            while (v[inf]<pivot) do  inf:=inf+1;
            while (v[sup]>pivot) do  sup:=sup-1;
         end;
      if inf<=sup then
       begin
         scambia(v[inf],v[sup]);
         inf:=inf+1;
         sup:=sup-1;
       end;
    until inf>sup;
    if (estremoi<sup) then ordinamento(estremoi,sup,v,ordinato);
    if (inf<estremos) then ordinamento(inf,estremos,v,ordinato);
end; 
begin
	readln(N,K);
	for i:=0 to N-1 do read(D[i]); readln;
	maxdist:=0;
	ordinamento (0,N-1,D, true);
	for i:=0 to N-1 do write(D[i+1]- D[i],' '); end.
		diff[0]:=D[0]; diff[N-1]:=K-D[N-1]; diff[1]:=D[2]-D[1]; writeln(diff[1]);
	for i:=1 to N-2 do begin diff[i]:=D[i+1] - D[i]; write(diff[i],' '); end; writeln; end.
	
	 end.
	for i:= 0 to n - 1 do
	                begin
	                	 if (D[i + 1] - D[i]) >= maxdist then 
	                                                begin 
	                                                 maxdist := D[i + 1] - D[i];
                                                     pos := D[i];
                                                    end;
    					if ((D[0] <> 0) and (D[0] >= maxdist/2)) then
                                         begin
                                          maxdist := 0;
                                          pos := 0;
                                         end;
    					if (k - D[n - 1]) >= max/2 then
                                if (k - D[n - 1]) >= D[0] then 
                                                            begin
                                                              maxdist := 0;
                                                              pos := k;
                                                            end;
                   end;                                                 
    writeln ((max div 2) + pos);
end.
