s=input()
search=input()
print(s.startswith(search))
print(s.endswith(search))

'''
Input : learning python is very easy
learning
Output :
True
False


Input : learning python is very easy
easy
Output :
False
True
'''
