L = int(input()) M = int(input()) N = int(input()) n = 0 if N > 25: n = N%25 else: n = N r = N//25 print(r,n) d,m = (M+r)//4,(M+r)%4 print(d,m) s,l = (L+d)//10,(L+d)%10 print(n+m+l)