#include<stdio.h>
int main()
{
	int m, n, sum = 0;
	while (scanf("%d %d", &m, &n) != EOF)
	{
		int count = 0;
		for (int i = m; i <= n; i++)
		{
			int j = i;
			sum = 0;
			while (j)
			{
				sum += (j % 10) * (j % 10) * (j % 10);
				j /= 10;
			}
			if (sum == i)
			{
				printf("%d ", sum);
				count++;
			}

		}
		if (count == 0)
			printf("no");
		printf("\n");
	}

	return 0;
}