Template synthesis of macromolecules. Selective functionalization of an organic polymer