If $f$ is complex analytic on $S=\{x+iy : |x|<1, |y|<1\}$, continuous on $\bar{S}$ and bounded by $1,2,3,4$ on each side, then is $|f(0)|>2$ possible? I'm a second-year undergraduate taking an introductory course in complex analysis. I am stuck on this problem from one of the previous year's exam:

True or False: For a function $f$ analytic on $S = \{ x + iy : x \in \mathbb{R}, y \in \mathbb{R}, |x| < 1, |y| < 1 \}$ and continuous on $\bar{S} = \{ x + iy : x \in \mathbb{R}, y \in \mathbb{R}, |x| \leq 1, |y| \leq 1 \}$, and satisfying that $|f|$ is bounded on the four sides $\gamma_1, \gamma_2, \gamma_3, \gamma_4$ of the square $\bar{S}$ respectively by $1, 2, 3, 4$, it is possible to have $|f(0)| > 2$.

I'm not able to disprove the existence of such a function or construct an example of such a function, but my guess is that it should be false. We have learnt about the Maximum Modulus Theorem, which says that

A non-constant holomorphic function on an open connected domain never attains its maximum modulus at any point in the domain.

Maybe by shifting the function $f$ by some constant or linear function I can show that it violates this Theorem, and so $f$ cannot exist, but I am not able to come up with a proof.
Another result that we were taught that seems relevant is the Schwarz Lemma, which says that:

Let $\mathbb{D} = \{ z : |z| < 1 \}$ be the open unit disk and let $f \colon \mathbb{D} \to \mathbb{C}$ be a holomorphic map such that $f(0) = 0$ and $|f(z)| \leq 1$ on $\mathbb{D}$. Then $|f(z)| \leq |z|$ $\forall\ z \in \mathbb{D}$ and $|f'(0)| \leq 1$. Moreover, if $|f(z)| = |z|$ for some non-zero $z$ or $|f'(0)| = 1$, then $f(z) = az$ for some $a \in \mathbb{C}$ with $|a| = 1$.

Maybe by considering the restriction of $f$ to the unit disk and rescaling I could apply Schwarz Lemma, but I'm not sure how to go about this either.
Of course, I could be wrong and there is indeed such a function $f$, but in that case, I don't know how to go about constructing it.
How can I solve this problem? Any useful hints are also fine, a complete solution is not necessary.
 A: I think that actually one can construct such an example using a little harmonic function theory.
First, notice that by RMT and by symmetry there is a conformal map that extends to a homeomorphism from the closed unit disc to the closed square (and which is actually conformal everywhere outside the vertices), $F:\mathbb D \to S, F(0)=0, F(\pm 1, \pm i)$ being the vertices of the square in counterclockwise order corresponding to the circle ordering (so if one fixes the image of one vertex say $F(1)=(-1,-1)$, the others are fixed eg $F(i)=(1,-1)$ etc).
(One can write a formula for this as $F(z)=c\int_0^z\frac{dz}{\sqrt{1-z^4}}$ but that is not needed)
Consider the finite non-negative measure on the unit circle given by $0, \log 2, \log 3, \log 4$ on the four open arcs $(1,i), (i-1), (-1,-i), (-i,1)$ and by zero in the four points or if you want the absolute continuous one given by $d\mu=qdt$ where $q$ takes the given values on the four open arcs and is unimportant what finite value we give it at the $4$ roots of unity of order $4$
Let $u_1(re^{i\theta})=\frac{1}{2\pi}\int_0^{2\pi}\frac{1-r^2}{1-2r\cos (\theta-t)+r^2}d\mu(t)$ the Poisson transform of $d\mu$ which is harmonic, bounded and positive in the open disc and satisfying $u_1(re^{it}) \to q(t)$ non-tangentially outside the four special points; actually note that $u_1(0)=\frac{1}{2\pi}\int_0^{2\pi}d\mu(t)=\frac {\log 2+\log 3+\log 4}{4} >2$.
So considering $g=u+iv$ holomorphic in the unit disc, $h(z)=e^{g(z)}$ almost satisfies the required properties on the four arcs since $|h(z)|=e^{u(z)}$ and $|h(0)|=e^{\frac{\log 24}{4}}=24^{1/4}>2$ (however $h$ is not continuous on the boundary, though it is "almost" so) and then clearly $f(w)=h(F^{-1}(w))=e^{g(F^{-1}(w))}$ almost satisfies the requires properties on the square and $|f(0)|>2$;
But now it is clear that $h_1(z)=(1-\epsilon)h(rz)$ for $r$ close enough to $1$ and $\epsilon>0$ small will do (will satisfy the boundness properties on the arcs and will be continuous, even holomorphic on the closed disc) and then $|h_1(0)|>2$ if $1-r$ hence $\epsilon$ are small enough, so taking $f_1(w)=h_1(F^{-1}(w))$ solves the problem.
Note that since $F, F^{-1}$ are not conformal at the vertices, $f_1$ is only continuous on the closed square (though holomorphic outside the vertices) despite that $h_1$ is holomorphic on the closed unit disc
A: Yes, it can happen that $|f(0)|>2$. The existence of an example implies that some polynomial works, hence it's at least theoretically possible to write down an example "explicitly". Here's a sketch of a not-quite-elementary construction:
Let $\psi$ be a smooth function on the boundary such that $\psi=0$ on $\gamma_1$ and $\log(j-1)\le\psi\le\log j$ on $\gamma_j$, $j=2,3,4$, and also such that $\psi=\log j$ on "most of" $\gamma_j$, for example on all of $\gamma_j$ except two small subintervals at the ends.
Let $u$ be the solution to the Dirichlet problem with boundary data $\psi$. Note that $u$ is smooth up to the boundary, and hence so is the harmonic conjugate $v$. By symmetry the harmonic measure of $\gamma_j$ at the  origin is $1/4$; hence $u(0)$ is "close to" $\frac14(\log1+\log2+\log3+\log4).$
Note that $$\frac14(\log1+\log2+\log3+\log4)>\frac14(\log2+\log2+2\log2)=\log2.$$Let $f=e^{u+iv}$.
