Closed-form Green's functions of HED, HMD, VED, and VMD for multilayer media