import re
w = [i for i in input()]
a = ''
if w[0].isdigit():
a = a + '*' + w[0]
else:
a = a + w[0]
for i in range(1,len(w)):
if w[i-1].isdigit() and w[i].isdigit():
a = a + w[i]
elif w[i-1].isdigit() and not w[i].isdigit():
a = a + '*' + w[i]
elif not w[i-1].isdigit() and w[i].isdigit():
a = a + '*' + w[i]
elif not w[i-1].isdigit() and not w[i].isdigit():
a = a + w[i]
if a[-1].isdigit():
a = a + "*"
print(a)
w = [i for i in input()]
a = ''
if w[0].isdigit():
a = a + '*' + w[0]
else:
a = a + w[0]
for i in range(1,len(w)):
if w[i-1].isdigit() and w[i].isdigit():
a = a + w[i]
elif w[i-1].isdigit() and not w[i].isdigit():
a = a + '*' + w[i]
elif not w[i-1].isdigit() and w[i].isdigit():
a = a + '*' + w[i]
elif not w[i-1].isdigit() and not w[i].isdigit():
a = a + w[i]
if a[-1].isdigit():
a = a + "*"
print(a)