L = int(input()) M = int(input()) N = int(input()) sum = 100*L + 25*M + N if sum >= 1000 : a = sum // 1000 b = (sum - 1000*a) // 100 c = (sum - 1000*a - 100*b) // 25 d = sum - 1000*a - 100*b - 25*c print(sum, a, b, c, d) print(b+c+d) elif sum >= 100: a = sum // 100 b = (sum - 100*a) // 25 c = sum - 100*a - 25*b print(sum, a, b, c) print(b+c) elif sum >= 25: a = sum // 25 b = sum - 25*b print(sum, a, b) print(b) else: print(sum)