Let $C_q(K)$ be a group of $q$-chains on a given simplicial complex $K$. Since this is a free abelian group, its subgroup must be a free abelian group, especially $Z_q(K),B_q(K)$. Then we define the homology group $H_q(K)$ as $Z_q(K)/B_q(K)$. And here is a theorem:
Let $G,G_1,G_2$ be a modules. If $G\cong G_1\oplus G_2$, then $G/G_2\cong G_1$.
We can prove this easily. Corresponding $g+G_2$ to $g$, it indicates isomorphism.
As the passage above says, $Z_q(K)$ is some products of integers $Z$, and so is $B_q(K)$. And $r(B_q(K))\leq r(Z_q(K))$ since $B_q(K)$ is a subgroup of $Z_q(K)$, where $r(G)$ means the rank of abelian group $G$. For example, $Z_q(K)\cong Z\oplus Z$, $B_q(K)\cong Z$ will happen.
So $H_q(K)$ seems to be a free abelian group. For the example above, $H_q(K)\cong (Z\oplus Z)/Z \cong Z$ by the theorem. But I know this is not true. For instance, $H_1(K)\cong Z\oplus Z_2$ on the Klein Bottle. Could someone tell me where I was wrong? Thanks.