# How to construct Feynman diagram for decay of pseudoscalar $\phi$ meson?

I am struggling to understand the construction of the Feynman diagrams for the following decays:

The answer is given as follows:

I do not understand how the quark anti-quark pair in each diagram is produced. In the two weak interactions, the W boson changes the quark flavour but what is producing the other quarks? In the other interaction there is no mediating particle at all. Is it possible the answer is wrong and a gluon is missing? Is anyone able to explain these diagrams?