The sum of two numbers is 25 and the sum of their squares is 313. Find the numbers.