I have this formula and I need to resolve it with unification:

{ ¬ P1(h(x)), P2(g(y))} , {P1(z), P2(z), P1(h(y)), P3(g(y)) }

I have used this as a unificator:

$\displaystyle \sigma = z/h(v), x/v, y/v$

and I got {$\displaystyle P2(g(v)), P2(h(v)), P3(g(v))}$

However if I use the unificator:

$\displaystyle \sigma = z/g(v), x/v, y/v$

I get { P2(g(v))} , {P1(g(v)), P3(g(v)) }

so are both ways right or only one is right? In which case, which one is it then?