program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var finput,foutput:textfile; line:string;
    mass,s,d:array[1..256] of integer;
    buff:string;
    i,j,ind:integer;
    outline,outline2:string;
begin
assign(finput,'input.txt');
reset(finput);
readln(finput,line);
buff:='';
ind:=0;

for i:=1 to Length(line) do begin
  case (line[i]) of
  '0'..'9':begin buff:=buff+line[i]; end;
  '-':begin buff:=buff+line[i]; end;
  else if Length(buff)>0 then begin
    inc(ind);
    mass[ind]:=StrToInt(buff);
    buff:='';
  end;
  end;
end;
if (Length(buff)>0) then begin inc(ind); mass[ind]:=StrToInt(buff); end;
i:=1;
j:=0;
while (i<=ind) do begin
  inc(j);
  s[j]:=mass[i]+mass[i+1];
  d[j]:=mass[i]-mass[i+1];
  i:=i+2;
end;
outline:='';
for i:=1 to j do begin
outline:=outline+IntToStr(s[i])+' ';
end;
for i:=1 to j do begin
outline:=outline+IntToStr(d[i])+' ';
end;
outline2:='';
for i:=1 to Length(outline)-1 do outline2:=outline2+outline[i];
assign(foutput,'output.txt');
rewrite(foutput);
writeln(foutput,outline2);
close(foutput);
end.
