# def solution(N, number):
# answer = -1
# d = []
# for i in range(8):
# if i == 0:
# v = [N]
# else:
# if i % 2 == 1:
# v = [1, 0]
# else:
# v = [0, 2, 11]
# if i == 1:
# v.append(N * 11)
# elif i == 2:
# v.append(N * 111)
# elif i == 3:
# v.append(N * 1111)
# elif i == 4:
# v.append(N * 11111)
# for j in range(len(d[i - 1])):
# v.append(d[i - 1][j] + N)
# v.append(d[i - 1][j] - N)
# v.append(d[i - 1][j] * N)
# v.append(d[i - 1][j] // N)
# if d[i - 1][j] != 0:
# v.append(N // d[i - 1][j])
# if i > 1:
# for j in range(len(d[i - 2])):
# v.append(d[i - 2][j])
# v.append(d[i - 2][j] + 1)
# v.append(d[i - 2][j] - 1)
# v.append(d[i - 2][j] + N * 11)
# v.append(d[i - 2][j] - N * 11)
# v.append(N * 11 - d[i - 2][j])
# v.append(d[i - 2][j] N 11)
# v.append((d[i - 2][j] + N) // N)
# v.append((d[i - 2][j] - N) // N)
# if d[i - 2][j] + N != 0:
# v.append(N // (d[i - 2][j] + N))
# if d[i - 2][j] - N != 0:
# v.append(N // (d[i - 2][j] - N))
# v.append(d[i - 2][j] // (N * 11))
# if d[i - 2][j] != 0:
# v.append((N * 11) // d[i - 2][j])
# v.append((N * 2) // d[i - 2][j])
# v.append(d[i - 2][j] // (N * 2))
#
# if i > 2:
# for j in range(len(d[i - 3])):
# v.append(d[i - 3][j] + 11)
# v.append(d[i - 3][j] - 11)
# v.append(d[i - 3][j] + N * 111)
# v.append(d[i - 3][j] - N * 111)
# v.append(d[i - 3][j] N 11 + N)
# v.append(d[i - 3][j] N 11 - N)
# v.append(d[i - 3][j] N + N 11)
# v.append(d[i - 3][j] N - N 11)
# v.append(N 11 - d[i - 3][j] N)
# v.append((d[i - 3][j] + N * 2) // N)
# v.append((d[i - 3][j] + 1) // N)
# v.append((d[i - 3][j] - 1) // N)
# v.append((d[i - 3][j] + N) // (N * 2))
# v.append((d[i - 3][j] + 1) * N)
# v.append((d[i - 3][j] - 1) * N)
# if d[i - 3][j] + N * 2 != 0:
# v.append(N // (d[i - 3][j] + N * 2))
# if d[i - 3][j] + N != 0:
# v.append((N * 2) // (d[i - 3][j] + N))
# if i > 3:
# for j in range(len(d[i - 4])):
# v.append(d[i - 4][j] + 111)
# v.append(d[i - 4][j] - 111)
# if i > 4:
# for j in range(len(d[i - 5])):
# v.append(d[i - 5][j] + 1111)
# v.append(d[i - 4][j] - 1111)
#
# d.append(v)
# for i in range(8):
# qw = 0
# for j in range(len(d[i])):
# if d[i][j] == number:
# answer = i + 1
# qw = 1
# break
# if qw == 1:
# break
#
# return answer
#
#
# n, a = map(int, input().split())
# print(solution(n, a))
# def solution(participant, completion):
# answer = ''
# d = {}
# k = {}
# participant.sort(reverse=True)
# completion.sort(reverse=True)
# for i in range(len(participant)):
# if i != 0 and participant[i] == participant[i - 1]:
# d[participant[i]] += 1
# else:
# d[participant[i]] = 1
# k[participant[i]] = 0
# for i in range(len(completion)):
# k[completion[i]] += 1
# for i in range(len(participant)):
# if d[participant[i]] != k[participant[i]]:
# answer = participant[i]
# break
# return answer
#
# p = list(input())
# c = list(input())
# print(solution(p, c))
# def solution(nums):
# l = len(nums)
# nums.sort()
# p = 0
# for i in range(len(nums)):
# if i == 0 or nums[i] != nums[i - 1]:
# p += 1
# answer = min(l // 2, p)
# return answer
#
#
# qwe = list(map(int, input().split()))
# print(solution(qwe))
def solution(phone_book):
answer = True
l = len(phone_book)
for i in range(l):
for j in range(l):
if i == j:
continue
if len(phone_book[i]) > len(phone_book[j]):
continue
p = 0
for h in range(len(phone_book[i])):
if phone_book[i][h] != phone_book[j][h]:
p = 1
break
if p == 0:
answer = False
return answer
po = list(input().split())
print(solution(po))