Chemical reactivity in organized medium: building up a two-dimensional polymer