Let A and B be matrices, and let x and y be vectors such that neither is a scalar multiple of the other satisfying
Ax=y, Ay=x+2y
and
Bx=x+y, By=2y.
Then there exist scalars a, b, c, and d such that
(AB)x=ax+by, (BA)x=cx+dy.
Find a, b, c, and d.