s=""for x in(io.read()..":::"):gfind".-:"do s=s..("0000"..x):sub(-5,-2)end print(s:reverse():sub(-32):gsub(".","%0.").."ip6.arpa.")