The sum of three consecutive terms of an A. P. is 21 and the sum of their squares is 165. Find these terms.