words = None
while not words:
words = input("2 слова: ").split()[:2]
# a
print(words[0])
# b
if len(words) == 2:
print(words[1])
words = None
while not words:
words = input("2 слова: ").split()[:2]
# a
print(words[0])
# b
if len(words) == 2:
print(words[1])