Let the present age of Sandy be 'x' .
So, present age of Megan will be = x + 5
Therefore age of Sandy four years ago = x - 4
Age of Megan four years ago = x + 5 - 4 = x + 1
It is given that four years ago Megan was three years less than three times Sandys age.
So, an equation can be formed as follows;

Therefore the present age of Sandy is 8 years.