def mirror_floor_number(k):
    
    mirrored_digits = {'0': '0', '1': '1', '6': '9', '8': '8', '9': '6'}
    
    
    k_str = str(k)[::-1]
    
   
    mirrored_k = ""
    
    
    for digit in k_str:
        if digit in mirrored_digits:
            mirrored_k += mirrored_digits[digit]
        else:
            
            mirrored_k += digit
    
    return int(mirrored_k)


k = int(input('floor number:'))
mirrored_floor_number = mirror_floor_number(k)
print("Katya will see the number:", mirrored_floor_number)
