The sum of two numbers is 18 and the sum of their squares is 164. Find the numbers.