checking modularity like transformation property
Assume $M$ is a 4 manifold. Let $Z_v$ be partition function of fixed magnetic flux $v$ with all instanton configuration summed over where $v\in H^2(M,Z/nZ)$. $\tau$ denotes complex parameter on upper half plane. In the following the dot product is interpreted as cup product by $H^2(M,Z)\otimes H^2(M,Z)\to H^4(M,Z)=Z$.
Assume the following relations hold $Z_v(\tau+1)=exp(2\pi i(-\frac{c}{24}+h_v))Z_v(\tau)$ where $h_v=v\cdot v(\frac{1}{2N}-2)$ counts instanton number for $SU(N)/Z_N$ theory as one has to take dual group of $SU(N)$. Denote $T:\tau\to\tau+1$
Assume $S:\tau\to\frac{-1}{\tau}$. $b_2=dim H^2(M,Z)$ is the second betti number. $Z_u(\frac{-1}{\tau})=\pm N^{-b_2/2}\sum_v exp(2\pi i (v\cdot u)/N)Z_v(\tau)$.
Assume $\sum_v exp(\frac{2\pi i v\cdot v}{N})=N^{b_2}\delta_{u,0}$. 818
$(\star)$
The paper claims $(ST)^3=1$ results $Z_u$ transforming up to a constant. If one wants to get rid of that constant, one demands the equstion $exp(2\pi i c/24)^3=\pm N^{-b_2/2}\sum_v(-1)^{v^2}(exp(2\pi i/N))^{v^2/2}$ where $v^2=v\cdot v$.
I checked the following. Dropping $N^{-b_2/2}$ proportionality after $S$ transformation, I obtain $exp(2\pi i\frac{c}{24})^3Z_u((ST)^3\tau)=N^{-3b_2/2}\sum_{v_1,v_2,v_3}Z_{v_3}(\tau)\prod_{i\leq 3}exp(2\pi i (\frac{v_i\cdot v_{i-1}}{N}+h_{v_i}))$ where $v_0=u$. I do not see how to use $\sum_v exp(\frac{2\pi i v\cdot v}{N})=N^{b_2}\delta_{u,0}$ to reduce summation here. My guess is somehow I contract $v_2$ part to reduce summation to $v$. I could try to sum over $u$ again to replace $v_1$ summation by $\delta_{v_1,0}$ but this still left me with two more summations.
$\textbf{Q:}$ How do I obtain relation $exp(2\pi i c/24)^3=\pm N^{-b_2/2}\sum_v(-1)^{v^2}(exp(2\pi i/N))^{v^2/2}$ via $(\star)$ here? Outline will be sufficient. The paper seems to claim that one can reduce 3 summations by $(\star)$.
Ref. https://arxiv.org/pdf/hep-th/9408074.pdf (pdf page 51-52)
I am only using $\hat{Z}_v$ expression of eq 3.14, 3.15, 3.16(pdf page 47-48) to derive eq 3.20(pdf page 52) 818