PROGRAM NestedWith1(Output);
    TYPE
        String3 = PACKED Array[1..3] OF Char;
        Woman = RECORD
            Name: String3;
            Age: Integer;
        END;

        Man = RECORD
            Name: String3;
            W: Woman;           { comment this line and see the program output }
            Age: Integer;
        END;
    VAR
        M: Man;
        W, WW: Woman;
BEGIN
    WITH W DO BEGIN
        Name := 'zar';
        Age := 45
    END;

    WITH WW DO BEGIN
        Name := 'RAZ';
        Age := 54
    END;

    WITH M DO BEGIN
        Name := 'ali';
        W := WW;                { M.W = WW }
        Age := 50
    END;

    WITH M DO BEGIN
        WriteLn(Output, 'Name    : ', Name);
        WriteLn(Output, 'Age     : ', Age:3);
        WriteLn(Output, 'His Wife: ', W.Name) { M.W.Name }
    END;

    WriteLn(Output);
    WriteLn(Output, 'W.Name  : ', W.Name)
END.
