Let $X,Y \overset{\text{iid}}{\sim} \operatorname{Unif}(0,1)$. Let $$M = \min\{X,Y,1-Y,1-X,|X-Y|,1-|X-Y|\}.$$ Supposedly $\operatorname{image}(M) \subseteq (0,\frac13)$ and distribution of $M$ is $$F_M(m)= (3m(2-3m))1_{(0,\frac13)}(m) + 1_{(\frac13,\infty)}(m).$$ See here.
Question: How do I compute the distribution of $M$? I wonder if there's a clever way of doing this like with $W$ here. Below is what I've tried so far.
Well $|X-Y| \ge m$ and $1-|X-Y| \ge m$ tell me $m \le |X-Y| \le 1-m$. So it looks like I have 4 cases
$x+(m-1) \le y \le x-m$
$x+m \le y$
$y \le x-m$
$x-(m-1) \le y \le x+m$ (but I think I rule out this last case because here I have $m \ge \frac12$.
Then $X,Y,1-Y,1-X \ge m$ tell me $m \le X \le 1-m$ and $m \le Y \le 1-m$. So I guess the 3 cases become
$x+m-1 = \max\{m,x+m-1\} \le y \le \min\{x-m,1-m\} = x-m$
$x+m = \max\{m,x+m\} \le y \le 1-m$
$m \le y \le \min\{x-m,1-m\} = x-m$
But it seems if I do $\int_0^1 \int_{\cdot}^{\cdot} 1\, dy \,dx$ for each case and then add them up I get only $2-6m$.

