#include<iostream>
using namespace std;
int main()
{
long long a,b,c;
for(a=1; a<1000; a++)
{
for(b=1;b<1000; b++)
{
c = 1000-a-b;
if(a < b && b < c && (a*a + b*b - c*c == 0))
{
cout << a << ' ' << b << ' ' << c << '\n';
cout<<a*b*c << '\n';
}
}
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgIGxvbmcgbG9uZyBhLGIsYzsKICAgIGZvcihhPTE7IGE8MTAwMDsgYSsrKQogICAgewogICAgICAgIGZvcihiPTE7YjwxMDAwOyBiKyspCiAgICAgICAgewogICAgICAgICAgICBjID0gMTAwMC1hLWI7CiAgICAgICAgICAgIGlmKGEgPCBiICYmIGIgPCBjICYmIChhKmEgKyBiKmIgIC0gYypjID09IDApKQogICAgICAgICAgICB7CiAgICAgICAgICAgIAljb3V0IDw8IGEgPDwgJyAnIDw8IGIgPDwgJyAnIDw8IGMgPDwgJ1xuJzsKICAgICAgICAgICAgICAgIGNvdXQ8PGEqYipjIDw8ICdcbic7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0=