#include <iostream>
using namespace std;

int main() {
    for (int num = 100; num <= 999; num++) {
        int hundreds = num / 100;
        int tens = (num / 10) % 10;
        int units = num % 10;
        
        int sum = hundreds * hundreds * hundreds + 
                  tens * tens * tens + 
                  units * units * units;
        
        if (sum == num) {
            cout << num << endl;
        }
    }
    return 0;
}    
/**************************************************************
	Problem: 1058
	User: fuyijun
	Language: C++
	Result: Accepted
	Time:4 ms
	Memory:2072 kb
****************************************************************/