You may want to review regular GCDs first.

Sometimes the GCD will have more than one term. This is good news
for you, because that means it will usually be pretty obvious. For
example, suppose you're given −*x*(*y* − 1)
− 3*y*(*y* − 1). Then it should be clear
that both terms have the factor *y* − 1, so the whole
thing factors as (−*x* − 3*y*)(*y*
− 1).