**Sloane’s sequences**A025306, A025307 and A025308 gives the respective lists of positive integers (having at most 7 digits) that are the sum of 2 distinct nonzero squares in exactly n ways, whenever n= 5, 6 and 7.

Determine the respective maximum value and minimum value of an 8-digit base ten positive integer P, such that P is expressible as sum of 2 distinct nonzero squares in exactly n ways, whenever n = 5, 6 and 7. (P does not contain any leading zero.)