procedure Main is
   package Shapes is
      Too_Big, Too_Small : exception;
      type Shape is tagged record
         Side : Integer range 0 .. 10;
      end record;
      procedure Grow (S : in out Shape; By : Integer)
      with Exceptional_Cases => (Too_Big => True);
      type Square is new Shape with null record;
      overriding procedure Grow (S : in out Square; By : Integer)
      with Exceptional_Cases => (Too_Big | Too_Small => True);
   end Shapes;
   package body Shapes is
      procedure Grow (S : in out Shape; By : Integer) is
      begin
         if By > 10 - S.Side then
            raise Too_Big;
         end if;
         S.Side := S.Side + By;
      end Grow;
      overriding procedure Grow (S : in out Square; By : Integer) is
      begin
         if By < 0 then
            raise Too_Small;
         end if;
         Grow (Shape (S), By);
      end Grow;
   end Shapes;
begin
   null;
end Main;
