num=input('Enter the number(maximum four digits): ')
l=len(num)
if(l==1):
        print(num[0],' ones')
elif(l==2):
        print(num[0],' tens and ',num[1],' ones')
elif(l==3):
        print(num[0],' hundreds, ',num[1],' tens and ',num[2],' ones')
elif(l==4):
        print(num[0],' thousands, ',num[1],' hundreds, ',num[2],' tens, ',num[3],' ones')

    
    
        
    
    

    
        
        

    
         
   


    
        
        

    


        
    
        
    

    
    

