Tammy made fudge brownies and peanut butter brownies. Each batch of fudge brownies makes 7 pans. Each batch of peanut butter brownies makes 6 pans. Tammy made 5 batches and ended up with 31 pans of brownies. How many batches of each type of brownie did she make?