A school is organizing a cookout where hotdogs will be served. The hotdogs come in small packs and large packs. Each small pack has 8 hotdogs and each large pack has 18 hotdogs. The school bought 13 packs of hotdogs that have a total of 164 hotdogs. Determine the number of small packs purchased and the number of large packs purchased.