1. $A \rightarrow a B$
2. $A \rightarrow b$
3. $B \rightarrow A c$
Input string: $a a b c c$
We want the rightmost derivation in reverse (reductions).
Rightmost Derivation
Start symbol: $A$
Step 1:
$$
\begin{aligned}
& A \rightarrow a B \\
& a B
\end{aligned}
$$
Step 2:
$$
\begin{aligned}
& B \rightarrow A c \\
& \text { a Ac }
\end{aligned}
$$
Step 3:
$$
\begin{aligned}
& A \rightarrow a B \\
& a a B c
\end{aligned}
$$
Step 4:
$$
\begin{aligned}
& B \rightarrow A c \\
& \text { a a Acc }
\end{aligned}
$$
Step 5:
$$
\begin{aligned}
& A \rightarrow b \\
& a a b c c
\end{aligned}
$$
So the rightmost derivation is:
$$
A \Rightarrow a B \Rightarrow a A c \Rightarrow a a B c \Rightarrow a a A c c \Rightarrow a a b c c
$$
Reduction steps in a bottom-up parser correspond to reversing the rightmost derivation:
1. Start with $a a b c c$
2. Reduce $b \rightarrow A$ using $A \rightarrow b$ (print " 2 ") → a a A c c
3. Reduce $A c \rightarrow B$ using $B \rightarrow A c$ (print " 3 ") → а а в C
4. Reduce $a B \rightarrow A$ using $A \rightarrow a B$ (print "1") → a A c
5. Reduce $A c \rightarrow B$ using $B \rightarrow A c$ (print " 3 ") → а в
6. Reduce $a B \rightarrow A$ using $A \rightarrow a B$ (print " 1 ") → A
matches with option A