while True:
    a, b, c = sorted(map(int, input().split()))
    if a == 0 and b == 0 and c == 0:
        break
    print("right" if a ** 2 + b ** 2 == c ** 2 else "wrong")

a51dcd3e415bd05c2a5e10aad707495cc8845701
<mask token>

while True:
    a, b, c = sorted(map(int, input().split()))
    if a == 0 and b == 0 and c == 0:
        break
    print('right' if a ** 2 + b ** 2 == c ** 2 else 'wrong')

while True:
    a, b, c = sorted(map(int, input().split()))
    if a == 0 and b == 0 and c == 0:
        break
    print("right" if a ** 2 + b ** 2 == c ** 2 else "wrong")
