# import sys
while True:
    try:
        shorts = input()
        longs = input()
        allin = "true"
        for c in shorts:
            if c not in longs:
                allin = "false"
                break
        print(allin)
    except:
#         print(sys.exc_info())
        break