John is 8 years older than Sam. The sum of their ages is 38. How old is Sam and John?