import java.util.Scanner;
public class something
{
    public static void main(String[]args)
    {
        Scanner scan=new Scanner(System.in);
        int[]m=new int[5];
        int[]w=new int[5];
        for(int i=0;i<5;i++)
            m[i]=scan.nextInt();
        for(int i=0;i<5;i++)
            w[i]=scan.nextInt();
        int s=scan.nextInt();
        int u=scan.nextInt();
        int[] subs=new int[5];
        for(int i=0;i<5;i++)
            subs[i]=Math.max(150*(i+1),500*(i+1)-2*m[i]*(i+1)-50*w[i]);
        int totsubs=subs[0]+subs[1]+subs[2]+subs[3]+subs[4];
        int score=totsubs+100*s-50*u;
        System.out.println(score);
        System.out.println(subs[0]+" "+subs[1]+" "+subs[2]+" "+subs[3]+" "+subs[4]);
    }
}