import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') n = int(input()) a = 0 tmp = n t = 1 for i in range(10): if n % 10 == 7: a += t t *= 10 n //= 10 print(a,tmp-a)