The binary code for 3 is 11.
Address A[1:0] = 11 is decoded, and the bottom word line is asserted.
The value stored in memory location 3 is equal to 101.
All output lines are ANDed and subsequently ORed to produce the D[2:0]=101 result.
RAM chip diagram: