Quark dynamics and the weak non-leptonic decays of K and D mesons