Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		a, _ := strconv.Atoi(buf[0])
		b, _ := strconv.Atoi(buf[1])
		c, _ := strconv.Atoi(buf[2])
		d, _ := strconv.Atoi(buf[3])
		e, _ := strconv.Atoi(buf[4])
		f, _ := strconv.Atoi(buf[5])
		if a == 0 && b == 0 && c == 0 && d == 0 && e == 0 && f == 0 {
			break
		}
		fmt.Println(100-((5*a+3*b)*2)-(f-5*a-3*b-e)*3+15*a+15*b+15*(5*a+3*b)+c*7+d*2)
	}
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

#include <iostream>
#include <iomanip>
#include <cmath>
 
using namespace std;

const int b[]={
    0b0111111,
    0b0000110,
    0b1011011,
    0b1001111,
    0b1100110,

    0b1101101,
    0b1111101,
    0b0100111,
    0b1111111,
    0b1101111
};
 
void print(int n){
    cout << bitset<7>(n) << endl;
}

int main(){
    int n;
    while(cin >> n, n!=-1){
        vi v(n);
        rep(i,n) cin >> v[i];
        rep(i,n){
            if(i==0) print(0^b[v[i]]);
            else print(b[v[i-1]]^b[v[i]]);
        }
    }
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <map>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,s,n) for(int i=s; i<n; i++)
#define ALL(x) x.begin(), x.end()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;

int main() {
	int b, r, g, c, s, t;
	while(cin >> b >> r >> g >> c >> s >> t, b||r||g||c||s||t) {
		int coin = 100;
		t -= (s + b*5 + r*3);
		coin -= t*3;
		coin += 15*b + 15*r + 7*g + 2*c;
		coin += 13*(5*b + 3*r);
		cout << coin << endl;
	}
	return 0;
}

C++: //48
#include<iostream>

using namespace std;

int main(){
  for(int b,r,g,c,s,t;cin>>b>>r>>g>>c>>s>>t,b|r|g|c|s|t;){
    cout<<(15+16*5)*b+(15+16*3)*r+7*g+2*c+3*s-t*3+100<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;

int main(void){
  int b,r,g,c,s,t;
  while(cin>>b>>r>>g>>c>>s>>t,b+r+g+c+s+t){
    int bg = b*5 + r*3;
    t -= bg + s;
    int m = 100 - t * 3 + bg * 13 + b * 15 + r * 15 + g * 7 + c * 2;
    cout<<m<<endl;
  }
}

C++: #include <iostream>
using namespace std;

int main(void){
  int a,b,c,d,e,f;

  while(cin>>a>>b>>c>>d>>e>>f, (a || b || c || d || e || f)){
    int sum = 100;

     sum += 77 * a;
    f -= 6 * a;

    sum += 51 * b;
    f -= 4 * b;

    sum += 4 * c;
    f -= c;

    //-d : Q[JnÉ3üêÄ, `F[Ìê2ÔÁÄ­é
    sum -= d;
    f -= d;

    //e*3 : Q[JnÌRC
    sum -= e * 3;
    f -= e * 2;

    //3*f : cèQ[ñÅ3¸ÂüµÄ»ëíÈ©Á½
    sum -= 3 * f;

    cout<<sum<<endl;
  }

  return 0;
}

C++: #include <cstdio>
int main() {
    int b,r,g,c,s,t;
    while (scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t)) {
        if (!b&&!r&&!g&&!c&&!s&&!t) break;
        int res=100+12*(b+r)+13*(b*5+r*3)-c+4*g;
        t-=b*6+r*4+c+g+s;
        printf("%d\n",res-t*3);
    }
}

C++: #include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  while( 1 ) {
    int b, r, g, c, s, t;
    int metal = 100;
    cin >> b >> r >> g >> c >> s >> t;
    if( !( b | r | g | c | s | t ) ) { break; }
    metal += ( b * 15 * ( 1 + 5 ) ); // 777 and Big bonus
    metal += ( r * 15 * ( 1 + 3 ) ); // BBB and Reg bonus
    metal += ( g * 7 );
    metal += ( c * 2 );

    int br = b * 5 + r * 3;
    metal -= ( 3 * ( t - br - s ) + 2 * br ) ;
    cout << metal << endl;
  }

  return EXIT_SUCCESS;
}

C++: #include <iostream>

using namespace std;

int main() {

  int b,r,g,c,s,t;

  int medals;


  while(cin >> b >> r >> g >> c >> s >> t) {

    if(b==0 && r==0 && g==0 && c==0 && s==0 && t==0) break;

    medals=100;

    //rbO{[iX(1ñÉÂ«v77Ì_ð¾éªÅ«AQ[ð6ñÁï·é)
    medals+=77*b;
    t-=6*b;

    //M[{[iX(1ñÉÂ«v51Ì_ð¾é±ÆªÅ«AQ[ð4ñÁï·é)
    medals+=51*r;
    t-=4*r;

    //ÊíQ[ÉuhEªµ¤(1ñÉÂ«v4Ì_ð¾é±ÆªÅ«AQ[ð1ñÁï·é)
    medals+=4*g;
    t-=g;

    //ÊíQ[É`F[ªµ¤(1ñÉÂ«1_ðæçêAQ[ð1ñÁï·é)
    medals-=c;
    t-=c;

    //X^[ªµ¤(Q[ð1ñÁï·é)
    t-=s;
    
    //cèÌQ[ÍSÄXJ
    medals-=3*t;

    cout << medals << endl;

  }

  return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>
#include <cmath>

using namespace std;

int main() {
  while ( true ) {
	int b, r, g, c, s, t;
	cin >> b >> r >> g >> c >> s >> t;
	if ( b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0 ) break;
	cout << 100 + b * 15 * 6 + 15 * r * 4 + g * 7 + c * 2 - 3 * ( t - s - b * 5 - r * 3 ) - 2 * ( b * 5 + r * 3 ) << endl;
  }  
}

C++: #include <iostream>

using namespace std;

int main() {
  for (;;) {
    int b, r, g, c, s, t;
    cin >> b >> r >> g >> c >> s >> t;
    if (!b && !r && !g && !c && !s && !t) return 0;
    cout << 100+b*15+r*15+g*7+c*2+(b*5+r*3)*(15-2)-(t-b*5-r*3-s)*3 << endl;
  }
}

C++: #include <cstdio>
#include <algorithm>
#include <map>


using namespace std;

int main(void)
{
	int b,r,g,c,s,t,coin,t2;
	
	while(1){
		scanf("%d %d %d %d %d %d",&b ,&r ,&g ,&c,&s ,&t);
		if(!(b||r||g||c||t))	break;
		/*t2=b*5+r*3;
		t-=b*5+r*3+s;*/
		coin=100+b*95+r*63+g*7+c*2-t*3+3*s;
		printf("%d\n" ,coin);
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<algorithm>

using namespace std;

#define rep(i, n) for(int i=0;i<(int)n;i++)
#define reep(i, s, t) for(int i=s;i<(int)t;i++)
#define irep(i, n) for(int i=(int)n-1;i>=0;i--)
#define ireep(i, n, s) for(int i=(int)n-1;i>=s;i--)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;



int main(){
	int b, r, g, c, s, t;
	while(cin >> b >> r >> g >> c >> s >> t) {
		if(!b && !r && !g && !c && !s && !t) break;
		int ans = 100;
		t -=r+b+g+c+(2*s)+(b*5)+(r*3);
		ans += (15*(b+r))+(((b*5)+(r*3))*13)-(3*(b+r+g+c+s))+((g*7)+(c*2)+(-3*t));
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  while(1){
    int b, r, g, c, s, t, ans = 100;
    cin >> b >> r >> g >> c >> s >> t;
    if(b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0) break;
    ans += b * 15;
    ans += r * 15;
    ans += g * 7;
    ans += c * 2;
    ans += b * 5 * 15 + r * 3 * 15;

    ans -= (t - s - b * 5 - r * 3) * 3;
    ans -= (b * 5 + r * 3) * 2;
    cout << ans << endl;

  }
}

C++: #include<iostream>
using namespace std;

main(){
  int b,r,g,c,s,t;
  while(cin >> b >> r >> g >> c >> s >> t, b || r || g || c || s || t){
    int m,pulas,total;
    int game;
    m=100+s*3+(5*b+3*r)-(3*t);
    pulas=b*15*6+r*15*4+g*7+c*2;
    total=m+pulas;
    cout << total << endl;
  }
}