while True:
try:
str1 = input()
str2 = input()
for c in str1:
if c not in str2:
print('false')
break
else:
print('true')
except:
break
while True:
try:
str1 = input()
str2 = input()
for c in str1:
if c not in str2:
print('false')
break
else:
print('true')
except:
break