Please help me understand the proof Doubt

In third line of the proof, why is Q $\rightarrow$ R ?

Thanks
The proof runs as follows :

1) $P$ --- assumed [a]

2) $\lnot R$ --- assumed [b]

3) $\lnot R \to (P \to \lnot Q)$ --- premise

4) $P \to \lnot Q$ --- from 2) and 3) by modus ponens

5) $\lnot Q$ --- from 1) and 4) by modus ponens

6) $\lnot R \to \lnot Q$ --- from 2) and 5) by Deduction Th (or Conditional Proof), discharging [b]

7) $Q \to R$ --- from 6) by Contraposition


  8)  $P \to (Q \to R)$ --- from 1) and 7) by Deduction Th (or Conditional Proof), discharging [a].
$ \neg R \implies \neg Q \Leftrightarrow Q \implies R$