n = input('請輸入數字:').split()
all_num = [] #分割後的數字
li = [] #所有數字
num = [] #被匹配的數字
for i in range(int(n[0]),int(n[1])):
li.append(i)
all_num.append(list(str(i)))
for j in range(len(all_num)):
all_num[j] = [int(all_num[j]) for all_num[j] in all_num[j]]
for i in range(len(all_num)):
for j in range(len(all_num[i])):
all_num[i][j] = all_num[i][j]**len(all_num[i])
for i in range(len(li)):
if sum(all_num[i]) == li[i]:
num.append(sum(all_num[i]))
if len(num) == 0:
print('none')
else:
for i in range(len(num)):
print(num[i],end=' ')