#!/usr/bin/env python
#-*-coding:utf8-*-
print u"Adresse longue par le calcul du CV17 et du CV18"
print u"Entrez l'adresse du décodeur :",
adress=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 u"Adresse complète en décimale encodée :",adress
print u"Adresse complète en binaire :",dec2bin
print u"Low Byte :",lowbyte
print u"High Byte :",highbyte
print u"Setting High Byte bits 8,7 :",highbyte87
print u"CV17 en décimal :",int(highbyte87,2)
print u"CV18 en décimal :",cv18dec
