Emir flew home from vacation with a heavy bag. With the first airline he flew, Emir had to pay $20 to check his bag, plus $10 for every pound that his bag was over the weight limit. The next flight was with another airline that had the same weight limit. Emir had to pay $5 per pound that his bag was over the weight limit, in addition to the checked bag fee of $30. By coincidence, the fees ended up being the same with both airlines. How large was each airline's fee?