The ages of three brothers add up to 38 years. The oldest brother is 5 years older than the youngest brother. Five years ago, the oldest was twice the age of the youngest. Write and solve a system of three equations in three variables to determine the ages of the brothers.