a=str(input("3045\n")) while(a!=1 and a!=4): x = list(str(a)) a=0 for i in x: a=a+int(i)**2 if(a==1): print("这个是快乐的数字") else: print("这个不是快乐的数字")