the right.

The entries to the right of $n$ form a layered permutation with at most two layers.

By the $4231$-avoidance of $\pi$ the entries to the right of $n$ avoid $231$, so to show that they are layered it suffices to show that they also avoid $312$. Suppose otherwise. Among all occurrences of $312$ choose one, $cab$, in which the ‘$1$’ and ‘$2$’ are as close together in position as possible (they will in fact be adjacent). Since $\pi$ is simple, $\{a,b\}$ cannot be an interval and thus (because they are adjacent) must be separated vertically. We claim that there is at least one such separator to the left of $n$. Let $x$ denote an arbitrary separator of $\{a,b\}$. We see that $x$ cannot lie horizontally between $n$ and $c$ by $4231$-avoidance. If $x$ were to lie horizontally between $c$ and $a$, then $\{x,a\}$ cannot be separated horizontally anywhere, nor vertically to the right of $n$, owing to the avoidance conditions, so must be separated vertically to the left of $n$. This separator therefore separates $\{a,b\}$ vertically to the left of $n$, as desired. The only other case is if $x$ lies to the right of $b$. In this 