import java.util.*; public class Main { public static void main(String[] args) { int flag = 0, i = 100 , a = 0, b = 0, c = 0; for(; i < 1000; i++) { a = i / 100; b = (i - 100 * a) / 10; c = i % 10; if( a*a*a + b*b*b + c*c*c == i) { if(flag == 0) { System.out.print(i); flag = 1; } else System.out.print(","+i); } } } }