Treatment of compound $\mathbf{O}$ with $\mathrm{KMnO}_4 / \mathrm{H}^{+}$gave $\mathbf{P}$, which on heating with ammonia gave $\mathbf{Q}$. The compound $\mathbf{Q}$ on treatment with $\mathrm{Br}_2 / \mathrm{NaOH}$ produced $\mathbf{R}$. On strong heating, $\mathbf{Q}$ gave $\mathbf{S}$, which on further treatment with ethyl 2-bromopropanoate in the presence of KOH followed by acidific tion, gave a compound $\mathbf{T}$.
The compound R is