#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int l, r;
int t = 0;
double sum = 0;
cin >> l >> r;
int arr[4] = { 0 };
for (int i = l; i <= r; i++)
{
t = i;
for (int j = 0; j < 4; j++)
{
arr[j] = t % 10;
t = t / 10;
if (t == 0)
{
break;
}
}
sum = pow(arr[0], 4) + pow(arr[1], 4) + pow(arr[2], 4) + pow(arr[3], 4);
if (sum == i)
{
cout << i << " ";
}
arr[4] = { 0 };
}
return 0;
}
#include <cmath>
using namespace std;
int main()
{
int l, r;
int t = 0;
double sum = 0;
cin >> l >> r;
int arr[4] = { 0 };
for (int i = l; i <= r; i++)
{
t = i;
for (int j = 0; j < 4; j++)
{
arr[j] = t % 10;
t = t / 10;
if (t == 0)
{
break;
}
}
sum = pow(arr[0], 4) + pow(arr[1], 4) + pow(arr[2], 4) + pow(arr[3], 4);
if (sum == i)
{
cout << i << " ";
}
arr[4] = { 0 };
}
return 0;
}