1.

package contestVolumes.volume118;
import java.util.Scanner;

/**
 * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
 * Problem: 11854 - Egypt
 * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=226&page=show_problem&problem=2954
 *
 * @author Siegfried Ippisch
 * @version 1.0
 *
 * Method : -
 * Status : Accepted
 * Runtime: 0.116
 */
public class Egypt {
   
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
       
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
       
        while(a != 0 || b != 0 || c != 0){
           
            int a2 = a*a;
            int b2 = b*b;
            int c2 = c*c;
           
            if(c > a && c > b)
                System.out.println(a2+b2==c2 ? "right": "wrong");
            else if(b > a && b > c)
                System.out.println(a2+c2==b2 ? "right": "wrong");
            else
                System.out.println(b2+c2==a2 ? "right": "wrong");
           
            a = in.nextInt();
            b = in.nextInt();
            c = in.nextInt();
        }
       
        in.close();
    }
   
}