from re import findall, sub
text = input()
ind = text.index(findall(r'[!.?]', text)[1])
print(text[0:ind+1] + sub(r'!', r'', text[ind+1:]))
from re import findall, sub
text = input()
ind = text.index(findall(r'[!.?]', text)[1])
print(text[0:ind+1] + sub(r'!', r'', text[ind+1:]))