array = [char for char in str(input())]
answer = "Нет."
for i in range(len(array) - 1):
if array[i] == array[i + 1]:
answer = "Да."
print(answer)
array = [char for char in str(input())]
answer = "Нет."
for i in range(len(array) - 1):
if array[i] == array[i + 1]:
answer = "Да."
print(answer)