You have N items that you want to put them into a knapsack. Item i has value vi and weight wi.

You want to find a subset of items to put such that:

* The total value of the items is as large as possible.
* The items have combined weight at most W, that is capacity of the knapsack.



Find the maximum total value of items in the knapsack.

Constraints

* 1 ≤ N ≤ 40
* 1 ≤ vi ≤ 1015
* 1 ≤ wi ≤ 1015
* 1 ≤ W ≤ 1015

Input


N W
v1 w1
v2 w2
:
vN wN


The first line consists of the integers N and W. In the following N lines, the value and weight of the i-th item are given.

Output

Print the maximum total values of the items in a line.

Examples

Input

4 5
4 2
5 2
2 1
8 3


Output

13


Input

2 20
5 9
4 10


Output

9
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    ll W;
    cin >> n >> W;
    vector<ll> v(n), w(n);
    rep(i, n) {
        cin >> v[i] >> w[i];
    }

    map<ll, ll> dp;
    rep(i, 1<<(n/2)) {
        ll nowv = 0, noww = 0;
        rep(j, n/2) if((i>>j)&1) {
            nowv += v[j];
            noww += w[j];
        }
        dp[noww] = max(dp[noww], nowv);
    }

    ll hhh = 0;
    vector<pair<ll, ll> > ddp(dp.size());
    int i = 0;
    for(auto nn:dp) {
        hhh = max(hhh, nn.second);
        ddp[i++] = make_pair(nn.first, hhh);
    }

    
    ll ans = 0;
    rep(i, 1<<((n+1)/2)) {
        ll nowv = 0, noww = 0;
        rep(j, (n+1)/2) if((i>>j)&1) {
            nowv += v[j+n/2];
            noww += w[j+n/2];
        }
        if(noww > W) continue;
        vector<pair<ll, ll> >::iterator itr = upper_bound(all(ddp), make_pair(W-noww+1, ll(-1)));
        ans = max(ans, (--itr)->second+nowv);
        //cout << noww << ' ' << nowv << ' ' << itr->second << endl;
    }

    cout << ans << endl;
    
}
