A group of friends is planning to buy some pizzas for a party. They need to buy a total of 36 slices of pizza. The pizzeria sells pizzas in two sizes: small pizzas with 6 slices each and large pizzas with 9 slices each. They decide to buy a combination of small and large pizzas. If they buy exactly 5 pizzas in total, how many of each size of pizza do they buy? Let's think step by step and output the final answer within \boxed{}.
user