Output nested lists according to syntax limitations