A contractor needs to buy nails to build a house. The nails come in small boxes and large boxes. Each small box has 100 nails and each large box has 450 nails. The contractor bought 3 more small boxes than large boxes, which altogether had 2500 nails. Determine the number of small boxes purchased and the number of large boxes purchased.