from math import sqrt
# a+b+c=1000 a^2+b^2=c^2
# a^2=c^2-b^2=(c+b)(c-b) 假设 c+b=s^2 c-b=t^2
# 所以 a^2=s^2*t^2 so a=s*t
# c=(s^2+t^2)/2 b=(s^2-t^2)/2
# 所以 s*t + (s^2+t^2)/2 + (s^2-t^2)/2 = 1000 --> s^2 + st = 1000 --> t=1000/s-s
for s in range(int(sqrt(500)), int(sqrt(1000))):
t = 1000/s - s
if t % 1 == 0:
if (s*t)**2+((s**2-t**2)/2)**2 == ((s**2+t**2)/2)**2:
print('a', s*t, sep=' is ')
print('b', (s**2-t**2)/2, sep=' is ')
print('c', (s**2+t**2)/2, sep=' is ')