#include <iostream>
using namespace std;
#include <iomanip>
int main()
{int count = 0;
for(int a=1;a<=500;a++)
{
for(int b=1;b<=500;b++)
{
for(int c=1;c<=500;c++)
{
if(c*c==a*a+b*b&&a<b)
{
cout<<a<<"\t"<<b<<"\t"<<c<<endl;
count=++count;
}
}
}
}
cout << "A total of " << count << " triples were found."<< endl;
return 0;
}