#include <iostream>
#include <cmath>
int main() {
std::size_t L = 100;
for (std::size_t b = 1; b <= L; b++) {
for (std::size_t a = 1; b >a; a++) {
for (std::size_t x = 1; x<=L; x++) {
for (std::size_t y = 1; y <= L; y++) {
for (std::size_t z = 1; z <= L; z++) {
double A = std::pow((a * a - b * b), x) + std::pow((2 * a * b), y);
double B = std::pow((a * a + b * b), z);
if (A == B) {
std::cout << '(' << a << "^2 -" << b << "^2)^" << x << "+(2*" << a << '*' << b << ")^" << y << "=(" << '(' << a << "^2 +" << b << "^2)^" << z << " ";
}
if (A > B) {
break;
}
}
}
}
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CmludCBtYWluKCkgewoKCXN0ZDo6c2l6ZV90IEwgPSAxMDA7CgoJZm9yIChzdGQ6OnNpemVfdCBiID0gMTsgYiA8PSBMOyBiKyspIHsKCQlmb3IgKHN0ZDo6c2l6ZV90IGEgPSAxOyBiID5hOyBhKyspIHsKCQkJZm9yIChzdGQ6OnNpemVfdCB4ID0gMTsgeDw9TDsgeCsrKSB7CgkJCQlmb3IgKHN0ZDo6c2l6ZV90IHkgPSAxOyB5IDw9IEw7IHkrKykgewoJCQkJCWZvciAoc3RkOjpzaXplX3QgeiA9IDE7IHogPD0gTDsgeisrKSB7CgkJCQkJCWRvdWJsZSBBID0gc3RkOjpwb3coKGEgKiBhIC0gYiAqIGIpLCB4KSArIHN0ZDo6cG93KCgyICogYSAqIGIpLCB5KTsKCQkJCQkJZG91YmxlIEIgPSBzdGQ6OnBvdygoYSAqIGEgKyBiICogYiksIHopOwoKCQkJCQkJaWYgKEEgPT0gQikgewoJCQkJCQkJc3RkOjpjb3V0IDw8ICcoJyA8PCBhIDw8ICJeMiAtIiA8PCBiIDw8ICJeMileIiA8PCB4IDw8ICIrKDIqIiA8PCBhIDw8ICcqJyA8PCBiIDw8ICIpXiIgPDwgeSA8PCAiPSgiIDw8ICcoJyA8PCBhIDw8ICJeMiArIiA8PCBiIDw8ICJeMileIiA8PCB6IDw8ICIgICI7CgkJCQkJCX0KCQkJCQkJaWYgKEEgPiBCKSB7CgkJCQkJCQlicmVhazsKCQkJCQkJfQoJCQkJCX0KCQkJCX0KCQkJfQoJCX0KCX0KCXJldHVybiAwOwp9