#первое что пришло в голову
numbers = [0,1,2,3,4,5,6,7,8,9]
n = int(input())
n2 = []
k = 0
while n > 0:
k = n % 10
n2.append(k)
n = n // 10
n2.reverse()
for i in range(len(numbers)):
if numbers[i] not in n2:
print(numbers[i],end=" ")
#первое что пришло в голову
numbers = [0,1,2,3,4,5,6,7,8,9]
n = int(input())
n2 = []
k = 0
while n > 0:
k = n % 10
n2.append(k)
n = n // 10
n2.reverse()
for i in range(len(numbers)):
if numbers[i] not in n2:
print(numbers[i],end=" ")