import sys
lst = list(input().split("."))
s = ""
# 长度不为4
if len(lst) != 4:
print("Error")
sys.exit(0)
# 有非数字
for i in lst:
if i == "":
print("Error")
sys.exit(0)
for j in i:
if "0" <= j <= "9":
pass
else:
print("Error")
sys.exit(0)
# 数字越线
for i in lst:
a = int(i)
if a < 0 or a > 255:
print("Error")
sys.exit(0)
for i in lst:
a = int(i)
if a < 16:
s += "0"
s += hex(a)[2:]
else:
s += hex(a)[2:]
print("0x" + s.upper())