#include <bits/stdc++.h>
using namespace std;
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define prin(a) cout<<a<<"\n"
#define kaigyo cout<<"\n"
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define mem(x) memset(x,0,sizeof(x))
#define mem1(x) memset(x,-1,sizeof(x))
const int INF=1<<28;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<string> vst;
typedef vector<char> vc;
typedef vector<long double> vd;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
typedef vector<vector<int>> vint2;
ll mod=1e9+7;
#define int1(x) int x;cin>>x;
#define int2(x,y) int x,y;cin>>x>>y;
#define int3(x,y,z) int x,y,z;cin>>x>>y>>z;
#define int4(x,y,z,w) int x,y,z,w;cin>>x>>y>>z>>w;
#define ll1(x) ll x;cin>>x;
#define ll2(x,y) ll x,y;cin>>x>>y;
#define vint1(a,n) vint a(n);rep(i,n)cin>>a[i];
#define vint2(a,b,n) vint a(n),b(n);rep(i,n)cin>>a[i]>>b[i];
#define vll1(a,n) vll a(n);rep(i,n)cin>>a[i];
const double pi=acos(-1.0);
const ll infl=1LL<<60;


bool isPrime(ll n){if(n<2)return false;for(ll x = 2;
x*x <=n;x++){if(n%x == 0)return false;}return true;}
ll kaizyo(ll k){ll sum=1;rep1(i,k){sum*=i;sum%=mod;}return sum;}
ll ncr(ll n,ll r){return kaizyo(n)/(kaizyo(r)*kaizyo(n-r));}
unsigned keta(unsigned num){
    return log10(num)+1;
}
ll gcd(ll a, ll b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
    return a * b / gcd(a, b);
}


int main(){
cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
int3(a,b,c);

if(a==b)cout<<'=';
else if(c%2==0){
    if(abs(a)>abs(b))cout<<'>';
    if(abs(a)<abs(b))cout<<'<';
    if(abs(a)==abs(b))cout<<'=';
}


else{
if(c>=1)cout<<((a>b)?'>':'<');
else if(c<=-1)cout<<((a>b)?'<':'>');
else cout<<'=';
}
}

#ifdef __LOCAL
  #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> bool chmin(T &a,T b) {if(a>b) {a=b; return true;} return false;}
#define itn int
#define fi first
#define se second
#define intmax numeric_limits<int>::max()
#define llmax numeric_limits<ll>::max()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>=1;i--)
#define all(vec) vec.begin(),vec.end()
#define sortt(vec) sort((vec).begin(),(vec).end())
#define rsort(vec) sort((vec).rbegin(), (vec).rend())
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;
const ll lnf=1ll<<60;

int main(){
  ll n,t; cin >> n >> t;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  vector<ll> b(0);
  vector<ll> c(0);
  rep(i,n){
    if(i<20) b.push_back(a[i]);
    else c.push_back(a[i]);
  }
  set<ll> st1;
  set<ll> st2;
  rep(i,1ll<<b.size()){
    ll sum=0;
    rep(j,b.size()){
      if(i&(1ll<<j)) sum+=b[j];
    }
    if(sum<=t) st1.insert(sum);
  }
  if(c.empty()){
    ll ans=0;
    for(auto v:st1){
      if(v<=t&&ans<v) ans=v; 
    }
    cout << ans << endl;
    return 0;
  }
  rep(i,1ll<<c.size()){
    ll sum=0;
    rep(j,c.size()){
      if(i&(1ll<<j)) sum+=c[j];
    }
    if(sum<=t) st2.insert(sum);
  }
  ll ans=0;
  for(auto v:st1){
    auto itr=st2.upper_bound(t-v);
    if(itr!=st2.begin()){
      ll x=*(--itr);
      if(ans<v+x) ans=v+x; 
    }
    else if(ans<v) ans=v;
  }
  cout << ans << endl;
}