6. A four-digit number, the sum of the digits in the thousands and tens places is 9, the sum of the digits in the hundreds and units places is also 9, and it is a perfect square. The largest such number is $\qquad$ .
$9801$