n = int(input('请输入位数:'))
for num in range(10**(n-1), 10**n):
if sum(map(lambda i: int(i)**n, str(num))) == num:
print(num)
n = int(input('请输入位数:'))
result = filter(lambda num: sum(map(lambda i: int(i)**n, str(num))) == num,
range(10**(n-1), 10**n))
for num in result:
print(num)