#include<bits/stdc++.h>

using namespace std;

int N,A,B,C;

int kadomatsu(int a,int b,int c,int i,vector<int> &vec){
  if(i==N){
    return;
  }
  else{
    kadomatsu(a+vec.at(i),b,c,i+1,vec);
    kadomatsu(a,b+vec.at(i),c,i+1,vec);
    kadomatsu(a,b,c+vec.at(i),i+1,vec);
    kadomatsu(a,b,c,i+1,vec);
  }
}

int main(){
  
  cin>>N>>A>>B>>C;
  vector<int> vec(N);
  
  for(int i=0;i<N;i++)
    cin>>vec.at(i);
  
  kadomatsu(0,0,0,0,vec);
}