From the previous working, the unchanged number is 24.

• Original sum a + b = 25 × 2 = 50
• a = 24, so b = 50 − 24 = 26
• The original number before replacement was 26.

• Check: Replace 26 with 21: (24 + 21) ÷ 2 = 45 ÷ 2 = 22.5. ✓

Final Answer: 26