public static void main(String args[]) {

        int a = 0;
        int b = 0;
        int c = 0;
        int sum;
        int sqr;
        int product;

        loop : for (c = 2; c > 0; c++) {
            for (b = 1; b < c; b++) {
                for (a = 1; a < b; a++) {
                    sqr =(int)(Math.pow(a, 2) + Math.pow(b, 2));
                    sum = a + b +c ;
                    if(sqr==(c*c) && sum==1000){
                        break loop;
                    }
                }
            }
        }
        product = a*b*c;
        System.out.println(product);
    }