Find the average and total capacity of dorms for the students with gender X.
return students ;return genders of #1 ;return #1 where #2 is  X ;return dorms for #3 ;return capacities of #4 ;return average of #5 ;return sum of #5 ;return #6 , #7
['select', 'project', 'comparative', 'project', 'project', 'aggregate', 'aggregate', 'union']