s = input()
t = input()
def func(s,t):
    for i in s:
        if i not in t:
            return "false"
    return "true"
print(func(s,t))