I am trying to find the chromatic polynomial for the following graph:

I know that the square graph acdba has a chromatic polynomial =

So, I figured I could use that and just include the last two vertices f and g. However, I noticed that I get a different equation depending on which vertex I choose first. If I choose g first I get:

but if I choose f first, I get:

and

The answer I have provided is the same as if I had chosen g first. Why does it matter and how can I know which vertex to choose first with other graphs?

Thanks.