L,M,N = input(),input(),input() N_amari = N%25 N = N/25 print N_amari MM = (M + N)/4 M_amari = (M + N)%4 print M_amari LL = (L + MM)/10 L_amari = L%10 print L_amari print N_amari+M_amari+L_amari