Find the average and maximum age for each type of pet.
return pets ;return types of  #1 ;return ages of  #2 ;return average of  #3 for each  #2 ;return maximum of  #3 for each  #2 ;return #4 ,  #5
['select', 'project', 'project', 'group', 'group', 'union']