lst=map(int,input().split(".")) s2 = bin(int(input()))[2:] s = '' for i in lst: s += bin(i)[2:].rjust(8,"0") print(int(s,2)) lst2 = [] while len(s2) > 8: i = len(s2)-8 lst2.append(int(s2[i:],2)) s2 = s2[:i] lst2.append(int(s2,2)) lst2.reverse() print(".".join(map(str,lst2)))