Reference request for a proof of the Mal'cev condition for congruence $n$-permutability By a theorem of Hagemann and Mitschke, a condition (A) that a variety $\mathcal{V}$ is congruence $n$-permutable, is equivalent to a condition (B) that there exist ternary terms $p_1,\dots,p_{n-1}$ such that $\mathcal{V}$ satisfies identities
$$x = p_1(x,y,y),\ \ p_i(x,x,y) = p_{i+1}(x,y,y),\ \ p_{n-1}(x,x,y) = y.$$
I know how to show that (B) implies (A), however I was not able to show the converse implication. I searched the literature, but it turns out that much of it is in German. I found no full proof in English of the implication (A) $\Rightarrow$ (B). The best I could find is the information that there is a third equivalent condition (C) that for every $A \in \mathcal{V}$ and every reflexive subalgebra $R$ of $A^2$, one has $R^{-1} \subseteq R^{n-1}$, where $R^{-1}$ is the converse relation and $R^{n-1}$ is the $(n-1)$-fold composition of $R$ with itself. I know how to show the equivalence of (C) and (B).
I would like to ask for a reference in English for the proof of the implication (A) $\Rightarrow$ (B) (or alternatively for sketching such a proof). In fact I am mostly interested in congruence $3$-permutability, so it would be enough for me if someone could provide a proof for the case $n = 3$. Note that a proof of the implication (A) $\Rightarrow$ (C) that does not make use of the equivalence of (A) and (B) would fulfill my request.
 A: The original paper is in English:
Hagemann, Joachim; Mitschke, A.
On $n$-permutable congruences.
Algebra Universalis 3 (1973), 8-12.

The proof given there is only a partial proof which depends
on an earlier paper (in German) by Hagemann.
I did not find the argument in any of the standard textbooks by Burris and Sankpannavar (1981), McKenzie-McNulty-Taylor (1987), or the one by Cliff Bergman (2012).
I did find a complete proof in English of $(A)\Rightarrow(B)$ in Algebras, Lattices, Varieties
Volume II by
Ralph S. Freese,
Ralph N. McKenzie,
George F. McNulty.
Walter F. Taylor. It is their Theorem 6.11.
I will state Theorem 6.11 here and make a few comments on the proof.

Theorem 6.11.
For a variety $V$ and an integer $k \geq 2$ the following conditions are equivalent:
(i) $V$ has $k$-permutable congruences.
(ii) $F_V(k + 1)$ has $k$-permutable congruences.
(ii') There exist terms $r_i(x_0 , x_1 , \ldots, x_k )$,
$i = 0, \ldots, k$ for $V$ such that the following are
identities of $V$:
$x_0 \approx r(x_0 , x_1 , \ldots, x_k)$,
$r_k (x_0 , x_1 , \ldots, x_k ) \approx x_k$, and
$r_{i−1}(x_0 , x_0 , x_2 , x_2 , \ldots) \approx r_i (x_0 , x_0 , x_2 , x_2 ,\ldots )$ for $i$ even,
$r_{i−1} (x_0 , x_1 , x_1 , x_3 , x_3,\ldots) \approx r_i (x_0 , x_1 , x_1 , x_3 , x_3 \ldots)$ for $i$ odd.
(iii) There exist terms $p_1 , \ldots, p_{k−1}$ for $V$ such that the following are identities of $V$:
$x \approx p_1 (x, z, z)$,
$p_1 (x, x, z) \approx p_2 (x, z, z)$
$\vdots$
$p_{k−2} (x, x, z) \approx p_{k−1} (x, z, z)$
$p_{k−1} (x, x, z) \approx z$. 
(iv) The subalgebra of $F_V^2(x, y) $
generated by $\langle x, x\rangle$, $\langle x, y\rangle$
and $\langle y, y\rangle$ contains elements
$\langle a_i , b_i\rangle$, $i = 0, \ldots,k$, with $\langle y, y\rangle = \langle a_0 , b_0\rangle$, $\langle x, x\rangle = \langle a_k , b_k\rangle$, and $b_i = a_{i+1}$.

The steps you are interested in are (ii) $\Rightarrow$ (ii') $\Rightarrow$ (iii).
For (ii) $\Rightarrow$ (ii'), use the fact that the congruences
$\theta_0 = \textrm{Cg}(\langle x_0,x_1\rangle, \langle x_2,x_3\rangle,\ldots)$ and $\theta_1 = \textrm{Cg}(\langle x_1,x_2\rangle, \langle x_3,x_4\rangle,\ldots)$ $k$-permute and have join containing $\langle x_0,x_k\rangle$. The argument to get the $r_i$'s follows a standard pattern.

For the implication (ii') $\Rightarrow$ (iii), define 
$p_i (x_0 , x_1 , x_2 ) = r_i (x_0 , \ldots , x_0 , x_1 , x_2 , \ldots , x_2 )$
where there are $i$ instances of $x_0$ followed by one instance of $x_1$ followed by $k-i$ instances of $x_2$.
