Phenol is acidic due to the resonance stabilization of the phenoxide ion. The introduction of an electron-withdrawing group such as -CHO increases acidity by stabilizing the negative charge on the oxygen atom.
Therefore, the acidity order is I<III<II.
\( \text{M} \xrightarrow{\text{CH}_3\text{MgBr}} \text{N} + \text{CH}_4 \uparrow \xrightarrow{\text{H}^+} \text{CH}_3\text{COCH}_2\text{COCH}_3 \)