#include <iostream>
#include <cmath>
bool Predicate(const int x, const int y, const int r)
{
int pred1 = std::max(x, y);
int max = std::max(pred1, r);
if (max == pred1)
{
if (pred1 == x)
{
return (x * x == ((y * y) + (r * r)));
}
else
{
return (y * y == ((x * x) + (r * r)));
}
}
else
{
return (r * r == ((x * x) + (y * y)));
}
}
int main(void)
{
std::cin.tie(NULL);
std::cout.tie(NULL);
std::cin.sync_with_stdio(false);
int x, y, r;
while (true)
{
std::cin >> x >> y >> r;
if (x == 0 && y == 0 && r == 0)
break;
std::cout << (Predicate(x, y, r) ? "right" : "wrong") << "\n";
}
return 0;
}
4153번: 직각삼각형 (acmicpc.net)