At a real estate agency, an agent sold a house for $318,000. The commission rate is 4.5% for the real estate agency and the commission rate for the agent is 25% of the amount the real estate agency gets. How much did the agency make on the house? How much did the agent earn in commission?