I'll use t for the messages Teresa sent, e for messages Eric sent, and r for messages Ryan sent.
Therefore we have, t+e+r=99.
From the text we also know:
e=3r ; r=t+6
If we substitute in the original equation we get:
t+3(t+6)+t+6=99; By simplifying it we get
5t=75 , therefore t=75/5=15.
Since Teresa send 15 messages,Ryan sent 6 more then here, so he send 21. Eric sent three times the
messages Ryan sent so he sent 63 messages. If we add them together 15+21+63, we get the total of 99 messages.