def to_bin(n): return bin(n)[2:]
def from_bin(s): return int(s,2)
def to_hex(n): return hex(n)[2:].upper()
def from_hex(s): return int(s,16)
assert to_bin(5)=="101" and from_bin("101")==5
assert to_hex(255)=="FF" and from_hex("FF")==255
print("SELF-TEST PASS")