3000^2+(4000-x)^2=x^2
x^2-(4000-x)^2=3000^2
(x+4000-x)(x-4000+x)=3000^2
4000(2x-4000)=3000^2
8000(x-2000)=9000000
x-2000=1125
x=3125
3000^2+(4000-x)^2=x^2
x^2-(4000-x)^2=3000^2
(x+4000-x)(x-4000+x)=3000^2
4000(2x-4000)=3000^2
8000(x-2000)=9000000
x-2000=1125
x=3125