For the first part we have 6 people and therefore must do 6 times 27 which gives us 162.
For our second portion we have 4 people so we do 4 times 23 which give us 92.
So the sum of the ages from the last 2 people must obviously be 162 minus 92 which gives us 70.
Since the sum of the ages of the last three must be 3 times 34 > 92, the age of the 4th person has to be 92 minus 70 > This gives us 22 as our final answer..