Let $R$ be a commutative Ring and $a,b,x,yin R$ and $ax=by$ and $<x,y>=R$ then $x|b$ and $y|a$

I have tried to use the property that $<x,y>=R$ but I cannot find a solution. Help or links to already existing answers would be apreaciated

$ax=by$ and $<x,y>=R$. Thus $mx+ny=b$ and $qx+ry=a$ hence $by=(qx+ry)x $

We have to find $w,z$ such that $wx=b$ and $zx=a$