Q) In a four digit number,The sum of the digits in the thousands,hundreds and tens is equal to 14 and the sum of the digit in units,tens and hundred is equal to 15.Among all the numbers satisfying these condition.find the number the sum of the squares of whose digit is greatest?

Thanks,