(a)
(b)
(c)
Source code for Example 2:
(a) InternalPad
(b) ExternalPad
(c) IntExtPad