A widget manufacturer builds three types of widgets: small, medium, and large. Each small widget sells for a profit of $15, each medium widget for a profit of $20, and each large widget for a profit of $10. The factory is divided into two sections. Section A does the molding work, while section B does the packaging. The small widget takes 1 hour in section A and 2 hours in section B. The medium widget takes 2 hours in A and 2 hours in B. The large widget takes 3 hours in A and 2 hours in B. This quarter, section A has a total of 400 hours available, and section B has 320 hours available. The manufacturer has ordered a supply of plastic that will build at most 1000 widgets, figuring the average amount used per widget. How many of each type of widget should be made to maximize profit? What is the maximum profit?