#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
#define loop(i,a,b) for(int i=(a); i<(b); i++)
#define rep(i,n) loop(i,0,n)

int a[4];

function<int(int,int)> f;

int main(){
    while(1){
        rep(i,4)cin>>a[i];
        if(accumulate(a,a+4,0)==0) break;

    }
}