Let's assume that Terri sold "x" candy bars last week.
According to the given information, Terri sold 9 fewer candy bars this week than she did last week. So, this week Terri sold (x - 9) candy bars.
It is also mentioned that Terri sold 4 times as many candy bars as Mary Ellen this week, and Mary Ellen sold 25 candy bars. Therefore, Terri sold 4 * 25 = 100 candy bars this week.
Since Terri sold (x - 9) candy bars this week, we can set up the equation:
x - 9 = 100
To find out how many candy bars Terri sold last week, we solve for x:
x = 100 + 9
x = 109
Therefore, Terri sold 109 candy bars last week. And Mary Ellen also sold 25 candy bars last week.