the ages of John and Mary total 27 years. Mary's age plus twice john's age is 40. how old is each person?