n = input()
t = True
for i in range(len(n)-1):
if n[i] == n[i+1]:
t = False
if t == False:
print('Да')
else:
print('Нет')
n = input()
t = True
for i in range(len(n)-1):
if n[i] == n[i+1]:
t = False
if t == False:
print('Да')
else:
print('Нет')