The school store sells Midville High T-shirts for $12 each and Midville High gym shorts for $9 a pair. One afternoon they sold a total of 53 T-shirts and pairs of shorts for a total of $570. How many T-shirts did they sell and how many pairs of shorts did they sell?