A green multicomponent synthesis of previously unreported octahydropyrimido[4,5-g]quinazoline-5,6-diones was developed from simple building blocks. These compounds show strong propensity towards self-assembled molecular network formation on graphite.