Assume that $\Omega$ is a bounded connected domain and $\partial \Omega \in C^{\infty}$. Denote $\Gamma_1,\Gamma_2,\cdots,\Gamma_n$ are $n$ connected components of $\partial\Omega$. This notation leads to $\partial \Omega=\cup^n_{i=1}\Gamma_i$. Consider the following problem. \begin{cases} \Delta \phi&=0\\ \phi|_{\partial \Omega}&=g(x),\quad g\in C^{\infty} \end{cases} Denote $\mathcal{S}$ is subset of $\{1,2,\cdots,n\}$ and $\mathcal{S}^c$ is $\{1,2,\cdots,n\}\setminus \mathcal{S} $. If we know that $$ \min_{i\in \mathcal{S}}\inf_{x\in \Gamma_i}\phi(x)\ge \max_{i\in \mathcal{S}^c} \sup_{x\in \Gamma_i} \phi(x)+\delta, $$ where $\delta$ is a positive constant, how to prove that \begin{align*} \sum_{i\in \mathcal{S}}\int_{\Gamma_i}\nabla \phi\cdot \vec{n}d\sigma>0? \end{align*} where $\vec{n}$ denotes the outer normal of $\partial \Omega$.

**My effort:** I meet this question when I read a paper. This paper say that it is a standard comparison principle exercise, but I still don't know how to solve this question. When $g(x)$ is a step function, we may consider Hopf Lemma or strong maximum principle. However, $g$ is a function. Any comments will be welcome.
the equation (2.51) of page 2992 in this paper