Type initialization / Structures

type
  TSize = record
    Width, Height: Integer;
    constructor Create(AWidth, AHeight: Integer);
  end;

  TPoint = record
    Top, Left: Integer;
    constructor Create(ATop, ALeft: Integer);
  end;

  TRectangle = record
    Size: TSize;
    Point: TPoint;
    constructor Create(ASize: TSize; APoint: TPoint);
  end;

constructor TSize.Create(AWidth, AHeight: Integer);
begin
  Width := AWidth;
  Height := AHeight;
end;

constructor TPoint.Create(ATop, ALeft: Integer);
begin
  Top := ATop;
  Left := ALeft;
end;

constructor TRectangle.Create(ASize: TSize;
  APoint: TPoint);
begin
  Size := ASize;
  Point := APoint;
end;

var
  Rect: TRectangle;
begin
  Rect := TRectangle.Create(
    TSize.Create(1010), TPoint.Create(55));

  WriteLn(Rect.Point.Top);
end.