const n = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');

n.forEach(num => {
    let [a, b, c] = num.split(' ').map(Number).sort((a,b)=>a-b);
    if(a===0 && b===0 && c===0) return;
    if(c**2 === a**2 + b**2) console.log("right");
    else console.log("wrong");
});