import re

data = input()
regex_pattern = r"\b[A-Z][a-z]+ +[A-Z][a-z]+\b"

valid_names = re.findall(regex_pattern, data)

print(*valid_names, sep=" ")
4bf5ba2feb711db264908fd45df0ba9736e70981
<mask token>

<mask token>
print(*valid_names, sep=' ')

<mask token>
data = input()
regex_pattern = '\\b[A-Z][a-z]+ +[A-Z][a-z]+\\b'
valid_names = re.findall(regex_pattern, data)
print(*valid_names, sep=' ')

import re
data = input()
regex_pattern = '\\b[A-Z][a-z]+ +[A-Z][a-z]+\\b'
valid_names = re.findall(regex_pattern, data)
print(*valid_names, sep=' ')

import re

data = input()
regex_pattern = r"\b[A-Z][a-z]+ +[A-Z][a-z]+\b"

valid_names = re.findall(regex_pattern, data)

print(*valid_names, sep=" ")