#!/usr/bin/env python
#-*-coding:utf8-*-
print("Adresse longue par le calcul du CV17 et du CV18")
print("Entrez l'adresse du décodeur :")
adress=eval(input())
dec2bin=bin(adress)[2:].zfill(16)
lowbyte=dec2bin[8:16]
highbyte=dec2bin[0:8]
highbyte87=str(11)+str(highbyte[2:9])
cv17dec=int(highbyte,2)
cv18dec=int(lowbyte,2)

print("Adresse complète en décimale encodée :",adress)
print("Adresse complète en binaire :",dec2bin)
print("Low Byte :",lowbyte)
print("High Byte :",highbyte)
print("Setting High Byte bits 8,7 :",highbyte87)
print("CV17 en décimal :",int(highbyte87,2))
print("CV18 en décimal :",cv18dec)

