program Check;

{$APPTYPE CONSOLE}

uses
  TestLib, SysUtils, Math;

var
  out_x, out_y, n, x1, x2, y1, y2: integer;

procedure get_coord(n: integer; var x:integer; var y:integer);
   var
      k, ring, corner1, corner1_x, corner1_y, corner2, corner2_x, corner2_y  : integer;
      corner3, corner3_x, corner3_y, corner4, corner4_x, corner4_y : integer;
begin
   if n=0 then begin x:=0; y:=0; exit; end;
   k := floor(sqrt(n));
   if not odd(k) then dec(k);
   ring := (k+1) div 2;
   
   corner1:=k*k+k;
   corner1_x:=ring;
   corner1_y:=-ring;
   corner2:=corner1+ring*2;
   corner2_x:=-ring;
   corner2_y:=-ring;
   corner3:=corner2+ring*2;
   corner3_x:=-ring;
   corner3_y:=ring;
   corner4:=corner3+ring*2;
   corner4_x:=ring;
   corner4_y:=ring;
   
   if (n <= corner1) then begin
      x := corner1_x; y := corner1_y + (corner1-n);
   end else if (n <= corner2) then begin
      x := corner2_x+(corner2-n); y := corner2_y;
   end else if (n <= corner3) then begin
      x := corner3_x; y := corner3_y - (corner3-n);
   end else begin
      x := corner4_x-(corner4-n); y := corner4_y;
   end
end;

function max(x, y:integer):integer;
begin
   if x < y then max := y else max := x;
end;

begin
   n := inf.ReadLongInt;
  out_x := ouf.ReadLongint; out_y := ouf.ReadLongint;
  
  if (out_x < 0) or (out_x > n) or (out_y < 0) or (out_y > n) or (out_x = out_y) then
   quit(_WA,Format('%d %d',[out_x,out_y]));
  
  get_coord(out_x,x1,y1);
  get_coord(out_y,x2,y2);
  
  if (out_x = out_y) or (out_x + out_y <> n) or ( max( abs(x1-x2), abs(y1-y2) ) > 1 ) then
   quit(_WA,Format('%d %d',[out_x,out_y]));
  
 if not ouf.SeekEof then quit(_PE,'Extra characters in output file.');

  quit(_OK,Format('%d = %d + %d',[n,out_x,out_y]));
end.
