#include <iostream>
using namespace std;

int main() {
    
    // write your code here......

    int b, s, g = 0;
    for (int i = 100; i<=999; i++)
        {
            b = i / 100;
            s = (i / 10) % 10;
            g = (i % 100) % 10;

            if ((b*b*b + s*s*s + g*g*g) == i)
                cout << i << endl;
        }

    return 0;
}