# Centers of groups and products of groups

I need to prove that the center of the product of two groups is the product of their centers.

If I let G and H be two groups, then from definitions, the center of G is Z(G)={z in G such that zg=gz for g in G} and the center of H is Z(H)={z in H sucht that zh=hz for all h in H}. Also, the product of G and H is GxH={(g,h) such that g in G and h in H}. My problem right now is that I'm not sure how to define the center of GxH and I'm not sure how to define the product of Z(G) and Z(H). I'm hoping that if I could understand these two things, I could do the problem.