#include<bits/stdc++.h>
using namespace std;
int n,i=100,g,s,b;
int main(){
	while(i<=999){ 
		g=i%10;
		s=i/10%10;
		b=i/100;
		if(g*g*g+s*s*s+b*b*b==i) cout<<i<<endl;
		i++;
	}
	return 0;
}
/**************************************************************
	Problem: 1058
	User: zhangziang
	Language: C++
	Result: Accepted
	Time:4 ms
	Memory:2072 kb
****************************************************************/