# https://stepik.org/lesson/22772/step/2?adaptive=true&unit=5346

a, b = input(), input()
print("{0} and {1} sat in the tree.".format(a, b))
print("{0} had fallen, {1} was stolen.".format(a, b))
print("What's remaining in the tree?")
