Integral cohomology of a circle bundle over a product of two spheres (source code)

= Integral cohomology of a circle bundle over a product of two spheres

Let $a,b$ be the standard basis of $H^2(S^2\times S^2;\mathbb Z)$ and let $E\to S^2\times S^2$ be an oriented circle bundle with Euler class $pa+qb\neq0$. If $d=\gcd(|p|,|q|)$, its <Gysin sequence of a sphere bundle>[Gysin sequence] gives
$$
H^i(E;\mathbb Z)\cong
\begin{cases}
\mathbb Z,&i=0,3,5,\\
\mathbb Z\oplus\mathbb Z/d,&i=2,\\
\mathbb Z/d,&i=4,\\
0,&\text{otherwise}.
\end{cases}
$$
For zero Euler class the bundle is trivial and its cohomology is that of $(S^2\times S^2)\times S^1$.