var x, y, z, res, rx, ry, i, j, u, v, w, cur: Integer; function min (a, b: Integer): Integer; begin if a < b then min := a else min := b end; function max (a, b: Integer): Integer; begin if a > b then max := a else max := b end; BEGIN read (x, y, z); res := z * 3; rx := -1; ry := -1; for i := 1 to z - 1 do for j := i + 1 to z - 1 do begin u := i - 0; v := j - i; w := z - j; if max (u, max (v, w)) - min (u, min (v, w)) <= 1 then begin cur := abs (x - i) + abs (y - j); if res > cur then begin res := cur; rx := i; ry := j; end; end; end; writeln (res); writeln (rx, ' ' , ry); END.