How do i calculate the rank and torsion coefficients of the following:

B=Z3 x Z14 x Z24 x Z126 x Z

C = <a,b,c,d: 168b=0, 42c=0, 18d=0>

Am i right in thinking that B can be decomposed to:

Z3=Z3

Z14=Z2 x Z7

Z24 = Z3 x Z8

Z126 = Z2 x Z9 x Z7

Of so how, do I combine to get the torsion and rank coefficient?

Also, for C, am I right in thinking that this is Z0 x Z168 x Z42 x Z18

If, so can someone help me decompose this and recombine so i can calculate rank and torsion