#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
  long n,m,p[1001];
  while(cin>>n>>m,n||m){
    for(int i=1;i<=n;++i) cin>>p[i];
    p[0]=0;
    vector<long> s(0);
    for(int i=0;i<=n;++i){
      for(int j=0;j<=n;++j) s.push_back(p[i]+p[j]);
    }
    sort(s.begin(),s.end());
    long a=0;
    for(vector<long>::iterator it=s.begin();*it<m/2;++it){
      a=max(a,*it+*(upper_bound(s.begin(),s.end(),m-*it)-1));
    }
    cout<<a<<endl;
  }
  return 0;
}

//Nayeem Shahriar Joy ,Applied Physics And Electronic Engineering , University of Rajshahi.

 #include<iostream>
#include<string>
#include<algorithm>
#include<vector>

using namespace std;


   int main(){
    int m, d, w;
    int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    string weekName[7] = {"Sunday", "Monday", "Tuesday", "Wednesday",
                         "Thursday", "Friday", "Saturday"};
    while(1){
        cin >> m >> d;
        if(!(m || d)){
            return 0;
        }
        w = 3;
        for(int i = 1; i < m; i++){
            w += days[i - 1];
        }
        w += d;
        cout << weekName[w % 7] << endl;
    }
}