#include<iostream>
#include <bits/stdc++.h>
#include<conio.h>
using namespace std;
int main()
{
	int m[5],w[5],s1[5],s2[5],a[5],s[]={500,1000,1500,2000,2500},t=0,h1,h2,i;
	for(i=0;i<5;i++)
	{
		cin>>m[i];
	}
	for(i=0;i<5;i++)
	{
		cin>>w[i];
	}
	cin>>h1>>h2;
	for(i=0;i<5;i++)
	{
		s1[i]=0.3*s[i];
		s2[i]=((250-m[i])*(s[i]/250)-50*w[i]);
	}
	for(i=0;i<5;i++)
	{
		if(s1[i]>=s2[i])
		{
			a[i]=s1[i];
		}
		if(s1[i]<s2[i])
		{
			a[i]=s2[i];
		}
	}
	for(i=0;i<5;i++)
	{
		cout<<a[i]<<endl;
		t+=a[i];
	}
	cout<<t<<endl;
	cout<<(t+h1*100-h2*50);
}