word=int(input())
times=[]
while word>1:
times.append(word%10)
word= word//10
sumeven=0;sumodd=0
for i in range(0,len(times),2):
sumeven+=times[i]
print(times)
for i in range(1,len(times),2):
sumodd+=times[i]
print(abs(sumeven-sumodd))