class Solution(object):
def helper(self, s, dotnum, ret, rets):
if dotnum > 4 or (len(s) / 3 > 4-dotnum):
return
if len(s) == 0:
if dotnum == 4:
rets.append(ret)
return
for i in range(1, 4):
tmp = s[:i]
if (dotnum == 3 and i > len(s)) or (i > 1 and s[0] == '0') or (int(tmp) > 255):
continue
self.helper(s[i:], dotnum+1, ret+'.'+tmp if len(ret) > 0 else tmp, rets)
def restoreIpAddresses(self, s):
rets = []
self.helper(s, 0, '', rets)
return len(rets)
s = input()
print(Solution().restoreIpAddresses(s))
for i in range(0,4):
print(i)