#include <bits/stdc++.h>

#define SQ(a) (a)*(a)

#define F0R(i, a) for(int i = 0; i < (a); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define R0F(i, a) for(int i = (a) - 1; i >= 0; i--)
#define ROF(i, a, b) for(int i = (b) - 1; i >= (a); i--)

#define ran() (rand() & 0x7FFF)
#define rand31() ((ran() << 16) | (ran() << 1) | (ran() & 1))
#define rand32() ((ran() << 17) | (ran() << 2) | (ran() & 3))
#define rand63() (((ll)ran() << 48) | ((ll)ran() << 33) | ((ll)ran() << 18) | ((ll)ran() << 3) | ((ll)ran() & 7))
#define rand64() (((ll)ran() << 49) | ((ll)ran() << 34) | ((ll)ran() << 19) | ((ll)ran() << 4) | ((ll)ran() & 15))

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define UB upper_bound
#define LB lower_bound
#define X real()
#define Y imag()
#define R real()
#define I image()
#define PI acos(-1)
#define MAXN 30

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<ld> point;
typedef complex<ld> cld;

namespace NTT {

const int MAX_DEG = 20, EXP_MULT = 119ULL, EXP = 23;
ull NTTMod = (EXP_MULT << EXP) + 1, NTTBuild[1 << MAX_DEG][2], rt[(1 << MAX_DEG) + 1];

ull modPow(ull a, ull p) {
    if(!p) return 1;
    if(p & 1) return a * modPow(a, p ^ 1) % NTTMod;
    ull sqrt = modPow(a, p >> 1);
    return SQ(sqrt) % NTTMod;
}

ull invMod(ull a) {
    return modPow(a, NTTMod - 2);
}

ull findCyclic() {
    vi multFactors;
    ull temp = EXP_MULT;
    for(int i = 2; i * i <= temp; i += 2) {
        if(temp % i == 0) multFactors.PB(i);
        while(temp % i == 0) temp /= i;
        if(i == 2) i--;
    }
    if(temp > 1) multFactors.PB(temp);
    FOR(i, 2, NTTMod) {
        bool works = 1;
        if(modPow(i, NTTMod >> 1) == 1) works = 0;
        for(const int factor : multFactors) if(modPow(i, NTTMod / factor) == 1) works = 0;
        if(works) return i;
    }
}

void buildRT() {
    if(rt[0] == 1) return;
    rt[0] = 1;
    rt[1] = modPow(findCyclic(), EXP_MULT << (EXP - MAX_DEG));
    FOR(i, 2, (1 << MAX_DEG) + 1) rt[i] = rt[i - 1] * rt[1] % NTTMod;
}

void ntt(int neededDeg, ull* vals, int len) {
    R0F(i, neededDeg + 1) {
        int arr = i & 1, narr = arr ^ 1, lli = 1 << i, llil = lli << 1, llndim1 = 1 << (neededDeg - i - 1), rtp = lli << (MAX_DEG - neededDeg);
        if(i == neededDeg) {
            F0R(j, len) NTTBuild[j][arr] = vals[j];
            FOR(j, len, lli) NTTBuild[j][arr] = 0;
        } else F0R(j, lli) {
            int x = j, y = 0, z = j, w = j + lli;
            F0R(k, llndim1) {
                NTTBuild[x][arr] = (NTTBuild[z][narr] + NTTBuild[w][narr] * rt[y]) % NTTMod;
                x += lli, y += rtp, z += llil, w += llil;
            }
            z = j, w = j + lli;
            F0R(k, llndim1) {
                NTTBuild[x][arr] = (NTTBuild[z][narr] + NTTBuild[w][narr] * rt[y]) % NTTMod;
                x += lli, y += rtp, z += llil, w += llil;
            }
        }
    }
}

void invntt(ull *p, int pdeg) {
    int mp = 1 << MAX_DEG;
    R0F(i, pdeg + 1) {
        int arr = i & 1, narr = arr ^ 1, lli = 1 << i, llil = lli << 1, llpdim1 = 1 << (pdeg - i - 1), rtp = lli << (MAX_DEG - pdeg);
        R0F(j, lli) {
            if(i == pdeg) NTTBuild[j][arr] = p[j];
            else {
                int x = j, y = mp, z = j, w = lli + j;
                F0R(k, llpdim1) {
                    NTTBuild[x][arr] = (NTTBuild[z][narr] + NTTBuild[w][narr] * rt[y]) % NTTMod;
                    x += lli, y -= rtp, z += llil, w += llil;
                }
                z = j, w = lli + j;
                F0R(k, llpdim1) {
                    NTTBuild[x][arr] = (NTTBuild[z][narr] + NTTBuild[w][narr] * rt[y]) % NTTMod;
                    x += lli, y -= rtp, z += llil, w += llil;
                }
            }
        }
    }
    ull u = invMod(1 << pdeg);
    F0R(i, 1 << pdeg) NTTBuild[i][0] *= u, NTTBuild[i][0] %= NTTMod;
}

};

using namespace NTT;

ull tempPVPoly[1 << MAX_DEG];

struct Polynomial {

    int deg;
    ull *coefficients;

    Polynomial(int d = 0) {
        deg = d;
        coefficients = new ull[deg + 1];
        memset(coefficients, 0, (deg + 1) * sizeof(ull));
        buildRT();
    }

    Polynomial operator ()(Polynomial p) {
        Polynomial curr;
        curr[0] = 1;
        Polynomial res;
        F0R(i, deg + 1) {
            res += curr * coefficients[i];
            curr *= p;
        }
        return res;
    }

    ull& operator [](int idx) { return coefficients[idx]; }

    Polynomial operator +(ull a) {
        Polynomial p(deg);
        F0R(i, deg + 1) p[i] = coefficients[i];
        p[0] += a;
        p[0] %= NTTMod;
        return p;
    }

    Polynomial operator -(ull a) {
        Polynomial p(deg);
        F0R(i, deg + 1) p[i] = coefficients[i];
        p[0] += NTTMod - a;
        p[0] %= NTTMod;
        return p;
    }

    Polynomial operator *(ull mult) {
        Polynomial p(deg);
        F0R(i, deg + 1) p[i] = coefficients[i] * mult % NTTMod;
        return p;
    }

    Polynomial operator /(ull div) { return *this * invMod(div); }

    Polynomial operator +(Polynomial b) {
        Polynomial res(max(deg, b.deg));
        F0R(i, max(deg, b.deg) + 1) res[i] = (((i > deg) ? 0 : coefficients[i]) + ((i > b.deg) ? 0 : b[i])) % NTTMod;
        return res;
    }

    Polynomial operator -(Polynomial p) { return *this + (p * (NTTMod - 1)); }

    Polynomial operator *(Polynomial b) {
        int neededDeg = 32 - __builtin_clz(deg + b.deg);
        ntt(neededDeg, coefficients, deg + 1);
        F0R(i, (1 << neededDeg)) tempPVPoly[i] = NTTBuild[i][0];
        ntt(neededDeg, b.coefficients, b.deg + 1);
        F0R(i, (1 << neededDeg)) tempPVPoly[i] = tempPVPoly[i] * NTTBuild[i][0] % NTTMod;
        invntt(tempPVPoly, neededDeg);
        Polynomial res(deg + b.deg);
        F0R(i, res.deg + 1) res[i] = NTTBuild[i][0];
        return res;
    }

    void operator +=(ull a) { coefficients[0] += a, coefficients[0] %= NTTMod; }

    void operator -=(ull a) { *this += NTTMod - a; }

    void operator *=(ull mult) { F0R(i, deg + 1) coefficients[i] *= mult, coefficients[i] %= NTTMod; }

    void operator /=(ull div) { *this *= invMod(div); }

    void operator +=(Polynomial b) { *this = *this + b; }

    void operator -=(Polynomial p) { *this = *this - p; }

    void operator *=(Polynomial b) { *this = *this * b; }

};

int n;
ull x[MAXN];
ull modX[MAXN];
vector<pair<Polynomial, pair<pair<ull, ull>, pair<ull, ull>>>> func;

Polynomial indefInt(Polynomial f) {
    Polynomial res(f.deg + 1);
    FOR(i, 1, res.deg + 1) res[i] = f[i - 1] * invMod(i) % NTTMod;
    return res;
}

Polynomial defInt(Polynomial f, Polynomial lo, Polynomial hi) {
    Polynomial F = indefInt(f);
    return F(hi) - F(lo);
}

Polynomial makeCopy(Polynomial p) {
    Polynomial res(p.deg);
    F0R(i, res.deg + 1) res[i] = p[i];
    return res;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    F0R(i, n) {
        string s;
        cin >> s;
        int numDecimalPlaces = 0;
        R0F(j, s.size()) if(s[j] == '.') numDecimalPlaces = s.size() - j - 1;
        ull base = modPow(10, 6 - numDecimalPlaces);
        R0F(j, s.size()) if(s[j] != '.') {
            x[i] += base * (s[j] - '0');
            base *= 10;
        }
    }
    x[0] = min(1000000ULL, x[0]);
    FOR(i, 1, n) x[i] = min(x[i], x[i - 1] + 1000000ULL);
    ull invMillion = invMod(1000000ULL);
    F0R(i, n) modX[i] = x[i] * invMillion % NTTMod;
    func.PB(MP(Polynomial(), MP(MP(0, 0), MP(x[0], modX[0]))));
    func[0].F[0] = 1;
    Polynomial xPoly(1);
    xPoly[1] = 1;
    F0R(i, n - 1) {
        vector<Polynomial> v2;
        vector<tuple<pair<ull, ull>, bool, int>> v;
        F0R(j, func.size()) {
            pair<double, ull> lo = func[j].S.F;
            pair<double, ull> hi = func[j].S.S;
            Polynomial loPoly;
            Polynomial hiPoly;
            loPoly[0] = lo.S;
            hiPoly[0] = hi.S;
            pair<double, ull> xVal = MP(x[i + 1], modX[i + 1]);
            pair<double, ull> loP1 = MP(lo.F + 1000000ULL, (lo.S + 1) % NTTMod);
            pair<double, ull> hiP1 = MP(hi.F + 1000000ULL, (hi.S + 1) % NTTMod);
            if(xVal.F > lo.F) {
                v2.PB(defInt(func[j].F, loPoly, xPoly));
                v.PB(MT(lo, 1, v2.size() - 1));
                v.PB(MT(min(hi, xVal), 0, v2.size() - 1));
            }
            if(hi.F < lo.F + 1000000ULL && xVal.F > hi.F) {
                v2.PB(defInt(func[j].F, loPoly, hiPoly));
                v.PB(MT(hi, 1, v2.size() - 1));
                v.PB(MT(min(loP1, xVal), 0, v2.size() - 1));
            }
            if(lo.F + 1000000ULL < xVal.F) {
                v2.PB(defInt(func[j].F, xPoly + (NTTMod - 1), hiPoly));
                v.PB(MT(loP1, 1, v2.size() - 1));
                v.PB(MT(min(hiP1, xVal), 0, v2.size() - 1));
            }
        }
        func.clear();
        sort(v.begin(), v.end());
        pair<ull, ull> last = MP(0, 0);
        Polynomial curr;
        for(const tuple<pair<ull, ull>, bool, int> t : v) {
            if(get<0>(t) > last) func.PB(MP(makeCopy(curr), MP(last, get<0>(t))));
            if(get<1>(t)) curr += v2[get<2>(t)];
            else curr -= v2[get<2>(t)];
            last = get<0>(t);
        }
    }
    Polynomial res;
    F0R(i, func.size()) {
        Polynomial lo, hi;
        lo[0] = func[i].S.F.S;
        hi[0] = func[i].S.S.S;
        res += defInt(func[i].F, lo, hi);
    }
    cout << res[0] << endl;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    cout<<n+k-n%k;
    return 0;
}


/*
oh fuck! GG!
 	by Furude_Rika
*/
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <iostream>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <stdlib.h>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <cstring>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <cstdio>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <algorithm>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <map>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <vector>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <stack>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <set>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <queue>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <fstream>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <cstdlib>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <utility>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <cmath>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
#include <functional>
// ♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂♂
using namespace std;
#define ll long long
#define ull unsigned long long
#define all(x) (x).begin(), (x).end()
#define ayacin ios::sync_with_stdio(false);
#define yukari 9999999999999999
#define mod 1000000007
#define M_PI12 3.141592653
#define Parseedouble long double
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define reimu iterator
#define x first
#define y second
const int MAXN=1e5+5;
int a[MAXN];
int main(){
	int m,n,i,j,k;
	ayacin;
	cin>>m;
	for(i=1;i<=m;i++) cin>>a[i];
	sort(a+1,a+1+m);
	reverse(a+1,a+1+m);
	for(i=2;i<=m;i++){
		if(a[i]*2>a[i-1]&&a[i]!=a[i-1]) return puts("YES");
	}
	return puts("NO");
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define ar array

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)

template<class T> bool umin(T& a, const T& b) {
	return b<a?a=b, 1:0;
}
template<class T> bool umax(T& a, const T& b) {
	return a<b?a=b, 1:0;
}

ll FIRSTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb)/2;
		f(mb)?rb=mb:lb=mb+1;
	}
	return lb;
}
ll LASTTRUE(function<bool(ll)> f, ll lb, ll rb) {
	while(lb<rb) {
		ll mb=(lb+rb+1)/2;
		f(mb)?lb=mb:rb=mb-1;
	}
	return lb;
}

template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(ar<A, S>& a);
template<class T> void read(T& x) {
	cin >> x;
}
void read(double& d) {
	string t;
	read(t);
	d=stod(t);
}
void read(long double& d) {
	string t;
	read(t);
	d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
	read(h);
	read(t...);
}
template<class A> void read(vt<A>& x) {
	EACH(a, x)
		read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
	EACH(a, x)
		read(a);
}

string to_string(char c) {
	return string(1, c);
}
string to_string(bool b) {
	return b?"true":"false";
}
string to_string(const char* s) {
	return string(s);
}
string to_string(string s) {
	return s;
}
string to_string(vt<bool> v) {
	string res;
	FOR(sz(v))
		res+=char('0'+v[i]);
	return res;
}

template<size_t S> string to_string(bitset<S> b) {
	string res;
	FOR(S)
		res+=char('0'+b[i]);
	return res;
}
template<class T> string to_string(T v) {
    bool f=1;
    string res;
    EACH(x, v) {
		if(!f)
			res+=' ';
		f=0;
		res+=to_string(x);
	}
    return res;
}

template<class A> void write(A x) {
	cout << to_string(x);
}
template<class H, class... T> void write(const H& h, const T&... t) {
	write(h);
	write(t...);
}
void print() {
	write("\n");
}
template<class H, class... T> void print(const H& h, const T&... t) {
	write(h);
	if(sizeof...(t))
		write(' ');
	print(t...);
}

void DBG() {
	cerr << "]" << endl;
}
template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h);
	if(sizeof...(t))
		cerr << ", ";
	DBG(t...);
}
#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

template<class T> void offset(ll o, T& x) {
	x+=o;
}
template<class T> void offset(ll o, vt<T>& x) {
	EACH(a, x)
		offset(o, a);
}
template<class T, size_t S> void offset(ll o, ar<T, S>& x) {
	EACH(a, x)
		offset(o, a);
}

mt19937 mt_rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) {
	return uniform_int_distribution<ll>(a, b)(mt_rng);
}

template<class T, class U> void vti(vt<T> &v, U x, size_t n) {
	v=vt<T>(n, x);
}
template<class T, class U> void vti(vt<T> &v, U x, size_t n, size_t m...) {
	v=vt<T>(n);
	EACH(a, v)
		vti(a, x, m);
}

const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

const int mxA=5e6, M=998244353;
int n, m;
ll iv[mxA], f1[mxA], f2[mxA];

ll inv(ll a, ll m) {
	return (a%=m)>1?(1-m*inv(m, a))/a+m:1;
}

void solve() {
	iv[1]=1;
	FOR(i, 2, mxA)
		iv[i]=M-M/i*iv[M%i]%M;
	f1[0]=f2[0]=1;
	FOR(i, 1, mxA) {
		f1[i]=f1[i-1]*i%M;
		f2[i]=f2[i-1]*iv[i]%M;
	}
	read(n, m);
	ll ans=0;
	FOR(x, 1, n+1) {
		int y=n-x;
		ll ca=(M+x%2*2-1)*f1[n]%M*f2[x]%M*f2[y]%M;
		//ll d=m*iv[x+m]%M*f1[x]%M*f1[y]%M*f2[n]%M;
		ll d=m*iv[x+m]%M;
		dbg(d, iv[4]);
		ca=ca*inv(M+1-d, M)%M;
		//ca=ca*f1[x]%M*f1[y]%M*f1[m]%M*f2[n+m]%M*f1[n+m+1]%M*f2[m+1]%M*f2[n]%M;
		ca=ca*f1[m]%M*f2[n+m]%M*f1[n+m+1]%M*f2[m+1]%M;
		//dbg(f1[x]%M*f1[y]%M*f1[m]%M*f2[n+m]%M*f1[n+m+1]%M*f2[m+1]%M*f2[n]%M);
		dbg(ca);
		ans+=ca;
	}
	print(ans%M);
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int t=1;
	//read(t);
	FOR(t) {
		//write("Case #", i+1, ": ");
		solve();
	}
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	int q,flag=0;
	cin >> q;
	int a,b;

	int arr[5][5]={0};
	for(int g=0;g<5;g++)
	arr[g][g]=-1;
	for(int i=0;i<q;i++)
	{
		cin >> a >> b;
		a--,b--;
		arr[a][b]=arr[b][a]=1;
	}
	/*for(int j=0;j<5;j++)
	{
	    for(int h=0;h<5;h++)
	    {
	        cout << arr[j][h] << " ";
	    }

	    cout << "\n";
	}*/

	for(int j=0;j<5;j++)
	{
		for(int k=0;k<4;k++)
		{
			for(int h=k+1;h<5;h++)
			{
				if(arr[j][k]+arr[j][h]+arr[h][k]==0 || arr[j][k]+arr[j][h]+arr[h][k]==3)
					flag++;
			}
		}
	}

	if(flag==0)
		cout << "FAIL" << endl;
	else
	    cout << "WIN" << endl;
	return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
//#define int long long
// int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1};
// int dx[]={2,2,-2,-2,1,1,-1,-1}; int dy[]={1,-1,1,-1,2,-2,2,-2};
const long long mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef vector< pair< int, int > > vii;
typedef map<int, int> mii;
typedef pair<int, ii> pip;
typedef pair<ii, int> ppi;
#define arrinp(arr,init,final,size,type) type* arr=new type[size];for(int i=init;i<final;i++)cin>>arr[i];
#define cr2d(arr,n,m,t) t**arr=new t*[n];for(int i=0;i<n;i++)arr[i]=new t[m];
#define w(t) int t;cin>>t; while(t--)
#define takeInp(n) int n;cin>>n;
#define fr(i,init,final) for(int i=init;i<final;i++)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
vi init(string s)
{
	istringstream sin(s);
	int n;
	vi arr;
	while(sin>>n)arr.push_back(n);
	return arr;
}
int pow(int x, int y)
{
	if(y==0)return 1;
	int u=pow(x,y/2);
	u=u*u;
	if(y%2)u=x*u;
	return u;

}
int gcd(int a,int b)
{
	if(a<b)return gcd(b,a);
	return (b==0?a:(a%b?gcd(b,a%b):b));
}
int gcd_e(int a,int b,int &x,int &y)
{

	if(b==0){x=1; y=0; return a;}
	int x1,y1;
	int p=gcd_e(b,a%b,x1,y1);
	x=y1;
	y=x1-(a/b)*y1;
	return p;
}
#define ll long long
ll solve(ll l,ll r,ll idx,ll h,ll flag)
{
	if(idx>r||idx<l)return ((ll)1<<(h+1))-1;
	if(l==r)return 0;
	if(flag)
	{
		ll q1=solve(l+(r-l+1)/2-1+1,r,idx,h-1,0);
		if(idx>(l+(r-l+1)/2-1)&&idx<=r)return q1+1;
		ll q2=solve(l,(l+(r-l+1)/2-1),idx,h-1,1);
		return q1+q2+1;
	}
	else
	{
		 ll q2=solve(l,(l+(r-l+1)/2-1),idx,h-1,1);

		if(idx<=(l+(r-l+1)/2-1)&&idx>=l)return q2+1;
		ll q1=solve(l+(r-l+1)/2-1+1,r,idx,h-1,0);
		return q1+q2+1;

	}
}
signed main()
{
	IOS
	ll n ,h;
	cin>>h>>n;
	ll q=solve(1,(ll)1<<h,n,h,0);
	cout<<q<<endl;

}


#include <stdio.h>
#include <utility>
typedef std::pair<int, int> ii;
using namespace std;

int abs(int a) {
    if (a > 0) return a;
    return -a;
}
int solve(int N) {
    ii c[4];
    int i;
    for (i = 0; i < 4; i++) {
        int x, y; scanf("%d %d", &x, &y);
        c[i] = { x, y };
    }
    if (N == 1) return -1;
    if (N == 2) {
        int area = (c[1].first - c[0].first) * (c[1].second - c[0].second);
        area = abs(area);
        if (area == 0) area = -1;
        return area;
    }
    if (N == 3) {
        int a1 = (c[1].first - c[0].first) * (c[1].second - c[0].second);
        int a2 = (c[2].first - c[1].first) * (c[2].second - c[1].second);
        int a3 = (c[2].first - c[0].first) * (c[2].second - c[0].second);
        if (a1 != 0) return abs(a1);
        if (a2 != 0) return abs(a2);
        return abs(a3);
    }
    if (N == 4) {
        int xmin = 1001, xmax = -1001, ymin = 1001, ymax = -1001;
        for (i = 0; i < 4; i++) {
            if (xmin > c[i].first) xmin = c[i].first;
            if (xmax < c[i].first) xmax = c[i].first;
            if (ymin > c[i].second) ymin = c[i].second;
            if (ymax < c[i].second) ymax = c[i].second;
        }
        return abs( (xmax - xmin) * (ymax - ymin)) ;
    }
    return -1;
}
int main(void) {
    int N; scanf("%d", &N);
    printf("%d\n", solve(N));
}


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <iostream>
#include <cmath>
using namespace std;
const int MAXN = 1000005;
int n, head[MAXN], cnt;
int endpoint[MAXN][2];
long long number[MAXN], d[MAXN];
bool vis[MAXN];
struct point
{
    long long x, y;
} P[MAXN];
long long dist(point a, point b)
{
    return abs(a.x - b.x) + abs(a.y - b.y);
}
bool operator < (point a, point b)
{
    return max(a.x, a.y) < max(b.x, b.y) || (max(a.x, a.y) == max(b.x, b.y) && a.y * b.x < b.y * a.x);
}
struct edge
{
    int v, nxt;
    long long value;
} Edge[MAXN];
struct node
{
    long long d;
    int id;
    node(long long _d, int _id):
        d(_d), id(_id) {}
};
bool operator < (node a, node b)
{
    return a.d > b.d;
}
void init()
{
    cnt = 0;
    memset(head, -1, sizeof(head));
    memset(vis, false, sizeof(vis));
    memset(d, 0x3f, sizeof(d));
    memset(endpoint, -1, sizeof(endpoint));
    d[0] = 0;
}
void addedge(int u, int v, long long value)
{
    Edge[cnt].v = v;
    Edge[cnt].value = value;
    Edge[cnt].nxt = head[u];
    head[u] = cnt;
    cnt++;
}
priority_queue <node> que;
int main(void)
{
    scanf("%d", &n);

    for(int i = 1; i <= n; i++)
    {
        scanf("%I64d%I64d", &P[i].x, &P[i].y);
        number[i] = max(P[i].x, P[i].y);
    }

    P[0] = (point){0, 0};
    number[0] = 0;

    sort(P, P + n + 1);
    sort(number, number + n + 1);
    int size = unique(number, number + n + 1) - number;

    init();
    int pos = 0;
    int tot = 0;

    for(int i = 0; i < size; i++)
    {
        tot = 0;
        while(max(P[pos].x, P[pos].y) == number[i])
        {
            if(tot == 0)
                endpoint[i][tot++] = pos;
            else if(max(P[pos + 1].x, P[pos + 1].y) != number[i])
                endpoint[i][tot++] = pos;
            ++pos;
        }
        if(endpoint[i][1] == -1)
            endpoint[i][1] = endpoint[i][0];
    }

    for(int i = 0; i < size; i++)
    {
        if(i < size - 1)
        {
            addedge(2 * i, 2 * (i + 1), dist(P[endpoint[i][0]], P[endpoint[i][1]]) + dist(P[endpoint[i][0]], P[endpoint[i + 1][1]]));
            addedge(2 * i + 1, 2 * (i + 1), dist(P[endpoint[i][0]], P[endpoint[i][1]]) + dist(P[endpoint[i][1]], P[endpoint[i + 1][1]]));
            addedge(2 * i, 2 * (i + 1) + 1, dist(P[endpoint[i][0]], P[endpoint[i][1]]) + dist(P[endpoint[i][0]], P[endpoint[i + 1][0]]));
            addedge(2 * i + 1, 2 * (i + 1) + 1, dist(P[endpoint[i][0]], P[endpoint[i][1]]) + dist(P[endpoint[i][1]], P[endpoint[i + 1][0]]));
        }
        else
        {
            addedge(2 * i, 2 * (i + 1), dist(P[endpoint[i][0]], P[endpoint[i][1]]));
            addedge(2 * i + 1, 2 * (i + 1), dist(P[endpoint[i][0]], P[endpoint[i][1]]));
        }
    }

    que.push(node(0, 0));

    while(!que.empty())
    {
        node current = que.top();
        que.pop();
        if(vis[current.id])
            continue;
        vis[current.id] = true;
        for(int i = head[current.id]; i != -1; i = Edge[i].nxt)
        {
            d[Edge[i].v] = min(d[Edge[i].v], d[current.id] + Edge[i].value);
            que.push(node(d[Edge[i].v], Edge[i].v));
        }
    }

    printf("%I64d\n", d[2 * size]);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int aa[155];
int main ()
{
    //freopen ("data.in","r",stdin);
    double x,t=10,b=45;
    int n;
    cin >>n;
    for (int i=0;i<n;i++)
    {
        cin >>aa[i];
        x+=aa[i];
    }
    sort(aa,aa+n);
    x*=t;
    if (x/n>=b)
    {
        cout <<"0"<<endl;
        return 0;
    }
    for (int i=0;i<n;i++)
    {
        x+=(5-aa[i])*t;
        if (x>=b*n)
        {
            cout <<i+1<<endl;
            return 0;
        }
    }
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[130];
	int i;
	for(i=0;i<n;i++)
		cin>>a[i];
		sort(a,a+n);
	int x,y;
	x=a[n-1];
	cout<<x<<' ';
		for(int i=n-1;i>=0;--i)
		{
		if(a[n-1]%a[i]!=0||a[i]==a[i-1])
		{
			cout<<a[i]<<endl;
			break;
		}
	}
	return 0;
}


#include "iostream"
#include "fstream"
#include "algorithm"
#include "iomanip"
#include "stack"
#include "queue"
#include "string"
#include "vector"
#include "map"
#include "set"
#include "list"
#include "deque"
#include "complex"
#include "bitset"
#include "cmath"
#include "unordered_set"
#include "unordered_map"
#include "iterator"
#include <ctime>
#include <cassert>
#include "numeric"
#include <cstdio>

using namespace std;

//#define f(i,n) for(int i=0; i<n;i++)
//#define rf(i, n) for(int i=n-1;i>=0;i--)
//#define forn(i, j, n) for(int i=j; i<n; i++)
//#define ff(i, j, n) f(i, n)f(j, n)
#define pb push_back
#define maxi(a,b) a = max(a, b);
#define mini(a,b) a = min(a, b);
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sqr(x) ((x) * (x))
#define SZ(a) ((int)(a.size()))
#define watch(x) cout << (#x) << " = " << x << endl;
//typedef long long ll;
typedef long double ld;
#define int long long
#define double ld
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<pii> vpii;
typedef vector<char> vc;
typedef vector<vi> vvi;

template<class T>
void show(const vector<T> &a)
{
	for (T x : a)
		cout << x << " ";
	cout << endl;
}

const int N = 3e5 + 50, oo = 1e18 + 100, mod = 1e9 + 7;
const double eps = 1e-9, PI = 2 * acos(0.0);
vi vertices[N];
vi g[N];
vi visit(N, 0);
int n, m, k;
int cnt = 0;

const int B = 4010;
int pref[N];
int col[N];

signed main()
{
	ios::sync_with_stdio(0);
	cout.tie(0); cin.tie(0);
	/*freopen("stars.in", "r", stdin);
	freopen("stars.out", "w", stdout);*/

	int d, k, a, b, t;
	cin >> d >> k >> a >> b >> t;

	int ans = oo;
	int time;

	vi check = { 0, 1, 2, d / k, d / k + 1 };

	if (d / k - 1 > 0)
		check.pb(d / k - 1);

	for (auto x : check)
	{
		time = 0;

		if (x)
			time += min(k*x, d)*a + (x - 1)*t;

		time += max(0ll, d - k*x)*b;

		mini(ans, time);
	}

	cout << ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define pb push_back
#define dbg(x) cerr << #x << " " << x << "\n"

#define TYPE 0

const int N = 1e5;

int n;
vector <int> gr[1 + N];
int villager[1 + N];
ll ans;

void dfsMin (int node, int par) {
    for (int son : gr[node])
        if (son != par)
            dfsMin (son, node);
    if (villager[node] == node) {
        if (par)
            swap (villager[node], villager[par]);
        else
            swap (villager[node], villager[gr[node].back ()]);
        ans += 2;
    }
}

void minimum () {
    for (int i = 1; i <= n; i++)
        villager[i] = i;
    dfsMin (1, 0);
    cout << ans << "\n";
    for (int i = 1; i <= n; i++)
        cout << villager[i] << " ";
    cout << "\n";
}

int order[1 + N];
int nr;
int sz[1 + N];
int sol[1 + N];
void dfsOrder (int node, int par) {
    order[++nr] = node;
    for (int son : gr[node])
        if (son != par)
            dfsOrder (son, node);
}

void dfsCalc (int node, int par) {
    sz[node] = 1;
    for (int son : gr[node])
        if (son != par) {
            dfsCalc (son, node);
            ans += 2 * min (sz[son], n - sz[son]);
            sz[node] += sz[son];
        }
}

void maximum () {
    dfsOrder (1, 0);
    for (int i = 1; i <= n; i++) {
        int from = i;
        int to = i + n / 2;
        if (to > n) to -= n;
        sol[order[to]] = order[from];
    }
    dfsCalc (1, 0);
    cout << ans << "\n";
    for (int i = 1; i <= n; i++)
        cout << sol[i] << " ";
    cout << "\n";
}

int main() {
    ios::sync_with_stdio (false);
    cin.tie (0); cout.tie (0);
    cin >> n;
    for (int i = 1; i < n; i++) {
        int x, y;
        cin >> x >> y;
        gr[x].pb (y);
        gr[y].pb (x);
    }
    if (TYPE)
        minimum ();
    else
        maximum ();
    return 0;
}


/**
 *    author: lucasfcm9
 *    created: 21.07.20 22:57:33
**/
#include <bits/stdc++.h>

using namespace std;

int a[23456789];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    cout << a[i] << (i + 1 == n ? '\n' : ' ');
  }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
#define rep(i,a,b) for (int i=a; i<=b; ++i)
#define per(i,b,a) for (int i=b; i>=a; --i)
#define mes(a,b)  memset(a,b,sizeof(a))
#define INF 0x3f3f3f3f
#define MP make_pair
#define PB push_back
#define fi  first
#define se  second
typedef long long ll;
const int N = 200005;

int n, b[N];
pair< int , int > p[N];
int main()
{
    scanf("%d", &n);
    rep(i,1,n)
        scanf("%d", &p[i].fi), p[i].se=i;
    sort(p+1, p+1+n);
    b[p[1].se] = p[n].fi;
    rep(i,2,n)
        b[p[i].se] = p[i-1].fi;
    rep(i,1,n)
        printf("%d ", b[i]);

    return 0;
}
/*
4
1000 10 1 100
*/


#include<bits/stdc++.h>
using namespace std;
const long long int mod=1e9+7;
long long int  magic(long long int r,long long int s)
{
   if(!s)         //if s==0
    return 1;
   long long int t=magic(r,s/2);
   t=t*t%mod;
   if(!(s&1))
    return t;
   return t*r%mod;
}
int main()
{
    long long int a,b,c;
    cin>>a>>b>>c;
    if(c<0&&((a+b)&1))cout<<0;
    else
        cout<<magic(magic(2,a-1),b-1);
    return 0;
}


//Problema Codeforces D - Dot
#define INVCICLE(i,a,b,c) for(int i = (a); i >= (b); i -= (c))
#define CICLE(i,a,b,c) for(int i=(a); i<=(b); i += (c))
#include <string.h>
#include <stdio.h>
#include <math.h>
int MEMO[450][450], TOT = 0;
bool InRange(int p) { return p >= 0 && p <= 400; }
double DST(int x, int y, int ax, int ay)
{
 double tmp = 1.0*((x-ax)*(x-ax) + (y-ay)*(y-ay)); return tmp;
 return sqrt(tmp);
}
//bool anton = false, dasha = false;
int x, y, n, d, ax[21], ay[21];

int Simule(int xx, int yy)
{
 //if(TOT > 99999) return 0; TOT++;
 //printf("Calculando para %d y %d\n",xx,yy);
 if(!InRange(xx) || !InRange(yy)) return 0;
 if(MEMO[xx][yy]!=-1) return MEMO[xx][yy];
 if(double(d) < DST(200,200,xx,yy))
 return MEMO[xx][yy] = 0;
 //if(player == 0) printf("Simulando DASHA desde %d  y %d\n",xx,yy);
 //if(player == 1) printf("Simulando ANTON desde %d  y %d\n",xx,yy);
 CICLE(p,1,n,1) if( Simule(xx + ax[p], yy + ay[p]) ) return MEMO[xx][yy] = 0;
 //if(player == 0 && anton == false)
 //{ anton = true; if(Simule((player+1)%2, yy, xx)) { anton = false; return false; } anton = false; }
 //if(player == 1 && dasha == false)
 //{ dasha = true; if(Simule((player+1)%2, yy, xx)) { dasha = false; return false; } dasha = false; }
 return MEMO[xx][yy] = 1;
}

int main()
{
 scanf("%d%d%d%d",&x,&y,&n,&d); d *= d;
 CICLE(p,1,n,1) scanf("%d%d",&ax[p],&ay[p]);
 CICLE(p,0,400,1) CICLE(q,0,400,1) MEMO[p][q] = -1;
 if(Simule(x+200,y+200) == 1) printf("Dasha");
 else printf("Anton");
}


#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <set>
#include <utility>
#include <cstring>
#include <stdio.h>
#include <queue>
#include <math.h>
#include<conio.h>
#include <CMATH>
#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

struct orc{
	int num;
	int x;
	int y;
};

bool myfunction (orc i,orc j) { return (i.x<j.x); }

struct Comp1
{
	bool operator()(const orc& str1, const orc& str2)
	{
		return str1.y < str2.y;
	}
};

//while(r - l != 0)
//    {
//        int64 mid =  MID(r,l);
//        if(mid * (mid + 1) / 2 >= n) r = mid;
//        else l = mid + 1;
//    }

int gcd(int a, int b) { return a ? gcd(b%a, a) : b; }

double q[2001];

int main(){

	int t;
	cin>>t;
	while(t--){
		vector<int> k;

		 int iSecret, iGuess;

	  	/* initialize random seed: */
		  srand (time(NULL));

		for(int i =0; i<=2000; i++)
			q[i]=0;

		for(int i =0; i<250; i++){
			int a;
			cin>>a;
			k.push_back(a);

		}

		for(int i = 0; i<1000; i++){
			iSecret = rand() % 250  ;
			k.push_back(k[iSecret]);
		}

		for(int i=0; i<k.size(); i++){
			q[k[i]]++;
		}

		double a=0;
		double b=0;

		for(int  i =0; i<k.size(); i++){
			a += q[i] * i ;
			b += q[i] * i * i ;
	 	}

	 	a=a/k.size();
	 	b=b/k.size();

	 	double e = a;
	 	double eq = b-a*a;
	 	int hghgh=0;
	 	double a1 = (eq - e*e/6);
	 	if(a1<0) a1=-a1;

		double b1 = (eq-e);

		if(b1<0) b1= -b1;

		if(a1>b1) {
			cout<<round(a)<<endl;
		}
		else {
			 cout << *max_element(k.begin(), k.end()) / 2 << "\n";
		}
	}
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#define int64 long long
using namespace std;
const int bignumlen=2200;
const int Blen=8;
const int64 base=100000000;
struct bignum{
	int len;
	int64 data[bignumlen];
	int64 &operator [](int x){ return(data[x]);}
	const int64 &operator [](int x)const { return(data[x]);}
	bignum (){
		memset(data,0,sizeof(data));
		len=0;
	}
	void clear(){
		for(int i=len;i>=1;--i)data[i]=0;
		len=0;
	}
	int check (const bignum &a,const bignum &b){
		if(a.len>b.len)return(0);
		if(b.len>a.len)return(1);
		for(int i=a.len;i>=1;--i){
			if(a.data[i]<b.data[i])return(1);
			if(b.data[i]<a.data[i])return(0);
		}
		return 2;
	}
	bool operator < (const bignum &b){ return(check(*this,b)==1);}
	bool operator > (const bignum &b){ return(check(*this,b)==0);}
	bool operator <=(const bignum &b){ return(check(*this,b)>=1);}
	bool operator >=(const bignum &b){ return(check(*this,b)%2==0);}
	bool operator !=(const bignum &b){ return(check(*this,b)!=2);}
	bool operator ==(const bignum &b){ return(check(*this,b)==2);}

	bignum operator=(const bignum &x){
		for(int i=x.len+1;i<=len;++i)data[i]=0;
		for(int i=1;i<=x.len;++i)data[i]=x.data[i];
		len=x.len;
		return *this;
	}
	bignum operator=(int64 x){
		for(int i=len;i>=0;--i)data[i]=0;
		len=0;
		while(x){
			data[++len]=x%base;
			x/=base;
		}
		return *this;
	}
	bignum(int64 x){
		memset(data,0,sizeof(data));
		len=0;
		(*this)=x;
	}
	bignum operator *(const bignum &b){
		int i,j;
		bignum tmp;
		for(i=1;i<=len;++i)if(data[i]!=0)
			for(j=1;j<=b.len;++j)if(b.data[j]!=0){
				tmp.data[i+j-1]+=data[i]*b.data[j];
				tmp.data[i+j]+=tmp.data[i+j-1]/base;
				tmp.data[i+j-1]%=base;
			}
		tmp.len=len+b.len-1;
		while(tmp.data[tmp.len+1])tmp.len++;
		return tmp;
	}
	bignum operator *(int64 x){
		int i;
		bignum tmp;
		for(i=1;i<=len;++i)tmp[i]=data[i]*x;
		tmp.len=len;
		for(i=1;i<=len;++i){
			tmp[i+1]+=tmp[i]/base,tmp[i]%=base;
			if(tmp[i+1]&&i+1>tmp.len)tmp.len++;
		}
		return tmp;
	}
	bignum operator /(int64 x){
		int i;
		bignum tmp;
		int64 y=0;
		for(i=len;i>=1;--i){
			y=y*base+data[i];
			tmp[i]=y/x;
			y%=x;
		}
		tmp.len=len;
		while(tmp[tmp.len]==0&&tmp.len>1)tmp.len--;
		return tmp;
	}
	bignum operator /(const bignum &b){
		if(b.len<=1 && b[1]==0){
			printf("error");
			for(;;);
		}
		int i,l1=(len-1)*Blen,l2=(b.len-1)*Blen;
		int64 x=data[len],y=b[b.len];
		while(x)x/=10,l1++;
		while(y)y/=10,l2++;
		bignum tmp,chu,B;
		chu=*this; B=b;

		for(i=1;i*Blen<=l1-l2;++i)B*=base;
		for(i=1;i<=(l1-l2)%Blen;++i)B*=10;
		for(i=l1-l2;i>=0;--i){
			x=0;
			while(chu>=B)chu-=B,x++;
			tmp[i/Blen+1]=tmp[i/Blen+1]*10+x;
			B/=10;
		}
		tmp.len=(l1-l2)/Blen+1;
		while(tmp.len>=1 && !tmp[tmp.len])tmp.len--;
		return tmp;
	}
	bignum operator +(const bignum &b){
		bignum tmp;
		int i,l=max(len,b.len);
		for(i=1;i<=l;++i)tmp[i]=data[i]+b[i];
		for(i=1;i<=l;++i)tmp[i+1]+=tmp[i]/base,tmp[i]%=base;
		tmp.len=l;
		if(tmp[tmp.len+1])tmp.len++;
		return tmp;
	}
	bignum operator +(int64 x){
		bignum tmp; tmp=*this;
		tmp[1]+=x;
		for(int i=1;i<=len&&tmp[i]>=base;++i)tmp[i+1]+=tmp[i]/base,tmp[i]%=base;
		while(tmp[tmp.len+1])tmp.len++;
		return tmp;
	}
	bignum operator -(const bignum &b){
		int i;
		bignum tmp;
		for(i=1;i<=len;++i)tmp.data[i]=data[i]-b.data[i];
		for(i=1;i<=len;++i){
			if(tmp[i]<0)tmp.data[i]+=base,tmp.data[i+1]--;
		}
		tmp.len=len;
		while(tmp[tmp.len]==0&&tmp.len>1)tmp.len--;
		return tmp;
	}
	bignum operator -(int64 x){
		bignum tmp; tmp=*this;
		tmp[1]-=x;
		for(int i=1;i<=len&&tmp[i]<0;++i){
			tmp[i+1]+=(tmp[i]+1)/base-1;
			tmp[i]=(tmp[i]+1)%base+base-1;
		}
		while(!tmp[tmp.len]&&tmp.len>1)tmp.len--;
		return tmp;
	}
	int64 operator %(int64 x){
		int i;
		int64 y=0;
		for(i=len;i>=1;--i)y=(y*base+data[i])%x;
		return y;
	}
	bignum operator %(const bignum &b){
		if(b.len<=1 && b[1]==0){
			printf("error");
			for(;;);
		}
		int i,l1=(len-1)*Blen,l2=(b.len-1)*Blen;
		int64 x=data[len],y=b[b.len];
		while(x)x/=10,l1++;
		while(y)y/=10,l2++;
		bignum chu,B;
		chu=*this; B=b;

		for(i=1;i*Blen<=l1-l2;++i)B*=base;
		for(i=1;i<=(l1-l2)%Blen;++i)B*=10;
		for(i=l1-l2;i>=0;--i){
			while(chu>=B)chu-=B;
			B/=10;
		}
		return chu;
	}

	bignum operator +=(const bignum &b){return *this=(*this+b);}
	bignum operator *=(const bignum &b){return *this=(*this*b);}
	bignum operator -=(const bignum &b){return *this=(*this -b);}
	bignum operator /=(const bignum &b){return *this=(*this/b);}
	bignum operator %=(const bignum &b){return *this=(*this%b);}
	bignum operator *=(int64 x) {return( *this=(*this *x));}
	bignum operator +=(int64 x) {return( *this=(*this +x));}
	bignum operator -=(int64 x) {return( *this=(*this -x));}
	bignum operator /=(int64 x) {return( *this=(*this /x));}
	void read(){
		char c[bignumlen*Blen+10];
		scanf("%s",c+1);
		int l=strlen(c+1);
		(*this).clear();
		int64 x;
		for(int i=1;i<=(l-1)/Blen+1;++i){
			x=0;
			for(int j=l-Blen*i+1;j<=l-Blen*i+Blen;++j)if(j>=1)x=x*10+c[j]-48;
			data[++len]=x;
		}
	}
	void write(){
		printf("%I64d",data[len]);
		for(int i=len-1;i>=1;--i)printf("%0*I64d",Blen,data[i]);
	}
}p,q,pp,qq;
bignum gcd(const bignum &A,const bignum &B){
	bignum a=A,b=B,res=1;
	while(!(a[1]&1)  && !(b[1]&1))a/=2,b/=2,res*=2;
	for(;;){
		if(a.len==1 && a[1]==0)return b*res;
		if(b.len==1 && b[1]==0)return a*res;
		while(!(a[1]&1))a/=2;
		while(!(b[1]&1))b/=2;
		if(a>b)a-=b;
		else b-=a;
	}
}
void YF(bignum &A,bignum &B){
	bignum tmp=gcd(A,B);
	A/=tmp; B/=tmp;
}
int n,i,x,num;
int main(){
	scanf("%d",&n);
	while(n%2==0){
		n/=2;
		num++;
	}
	if(n==1){
		printf("%d/%d\n",num,1);
		return 0;
	}
	p=0; q=1;
	pp=1; qq=1;
	for(i=n+1;;){
		if(i>n){
			if(q%(i-n)==0)q/=i-n;
			else p*=i-n;

			if(qq%(i-n)==0)qq/=i-n;
			else pp*=i-n;

			if(p%i==0)p/=i;
			else q*=i;

			if(pp%i==0)pp/=i;
			else qq*=i;

		}else p+=q;
		if(i==1)break;
		if(i%2==0)i/=2;
		else i+=n;
	}
	YF(p,q);
	p=p*qq;
	q=q*(qq-pp);

	p+=q*num;
	bignum tmp=gcd(p,q);
	(p/tmp).write();
	printf("/");
	(q/tmp).write();
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> inline void read(T &x){
	int f=0;x=0;char ch=getchar();
	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');
	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';
	if(f)x=-x;
}

const int mod=1e9+7;
int power(int x,int p){
	int res=1;
	for(;p;p>>=1,x=(ll)x*x%mod)
		if(p&1)res=(ll)res*x%mod;
	return res;
}
int n,m,res;

int main(){
	read(n),read(m);
	res=(ll)power(2,m)*power(n+1,m-1)%mod*(n+1-m)%mod;
	cout<<res<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define endl cout<<"\n";
#define test long long int t; cin>>t; while(t-->0)
#define fIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define loop(n) for(long long int i=0;i<n;i++)
using namespace std;

int main()
{
    fIO
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
      int n;
      cin>>n;
      int a[n],b[n];
      loop(n)
      cin>>a[i];
      int maxd=0;
      for(int i=0;i<n-1;i++)
      {
          b[i]=abs(a[i]-a[i+1]);
          maxd=max(maxd,b[i]);
      }
      int d=0,newmax=100005;
      for(int i=0;i<n-2;i++)
      {
          d=b[i]+b[i+1];
          newmax=min(d,newmax);
      }

        cout<<max(newmax,maxd);
    return 0;
}


#include<iostream>
using namespace std;
int main ()
{
	int a,b,d=1;
	cin>>a>>b;
	if(a<b)
		cout<<a<<" "<<(b-a)/2;
	else
		cout<<b<<" "<<(a-b)/2;
	return 0;
}


#include<cstdio>
#include<cstring>
int main()
{
    char a[101];
    char b[101];
    while(~scanf("%s%s",a,b))
    {
        int cnt=0;
        for(int i=strlen(a)-1;i>=0;i--)
        {
            if(i==strlen(a)-1)
            {
                a[i]+='b'-'a';
               int cnt1=(a[i]-'a')/(26);
                a[i]=(a[i]+cnt-'a')%(26)+'a';
                cnt=cnt1;

            }
            else
            {
              int cnt1 =(a[i]-'a'+cnt)/(26);
              a[i]=(a[i]+cnt-'a')%(26)+'a';
                cnt=cnt1;
            }
        }
        if(cnt!=0)
        {
            printf("No such string\n");
        }
        else
        {
            int p=1;
            for(int i=0;i<strlen(a);i++)
            {
                if(a[i]==b[i])
                {
                    continue;
                }
                else if(a[i]>b[i])
                {
                    p=0;
                    break;
                }
                else if(b[i]>a[i])
                {
                    p=2;
                    break;
                }
            }
            if(p==2)
            {
                a[strlen(a)]='\0';
                printf("%s\n",a);
            }
            else
            {
                printf("No such string\n");
            }
        }
    }
}


#include <bits/stdc++.h>
#define NN 5000
#define inf 0x3f3f3f3f

using namespace std;

int n,a,b,c;
int dp[NN];

int main () {

	cin>>n>>a>>b>>c;
	memset (dp,-inf, sizeof(dp));
	dp[0] = 0;
	for(int i=1; i<=n; i++) {
		if (i>=a) dp[i] = max(dp[i], dp[i-a]+1);
		if (i>=b) dp[i] = max(dp[i], dp[i-b] + 1);
		if (i>=c) dp[i] = max(dp[i], dp[i-c] + 1);
	}
	printf("%d\n", dp[n]);
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7, N = 4e4+5, K = 40;
bool draw[N][K], win[N][K], lose[N][K];
int a,p,x;
ll ipow(ll _a, ll _p){
    if(_p == 0)
        return 1;
    if(_p == 1)
        return _a;
    return min((ll)MOD,ipow(min((ll)MOD,_a*_a),_p/2)*ipow(_a,_p%2));
}
bool lost(int _a, int _p){
    return ipow(_a,_p) >= x;
}
int main(){
    cin >> a >> p >> x;
    if((x - (N-1))%2 == 0)
        win[N-1][1] = true;
    else
        lose[N-1][1] = true;
    for(int i = N-2; i >= 0; --i){
        for(int j = K-2; j >= 0; --j){
            if(lost(i,j)){
                win[i][j] = true;
                continue;
            }
            if(lose[i+1][j] || lose[i][j+1]){
                win[i][j] = true;
                continue;
            }
            if(win[i+1][j] && win[i][j+1]){
                lose[i][j] = true;
                continue;
            }
            draw[i][j] = true;
        }
    }
    if(win[a][p])
        puts("Masha");
    if(lose[a][p])
        puts("Stas");
    if(draw[a][p])
        puts("Missing");
}


#include <bits/stdc++.h>

using namespace std;

int main()
{ int zeros=0,n,tk;
long long  x =1 ;
bool flag = false ;
 scanf("%d",&n);
 if(n==1) { scanf("%d",&tk); tk ==0 ? printf("%d",0) : printf("%d",1); }else {
while(n--){
    scanf("%d",&tk);
    tk== 1 ? flag=true:flag;
    flag == true ? (tk == 0 ? ++zeros:(zeros != 0 ? x*= ++zeros,zeros=0:zeros )) : flag ;
}
flag==true ? cout<<x:cout<<0;
}
}


/*
 *    Author:  @khoya_musafir
 */

#include <bits/stdc++.h>
using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> index_set;
//typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>indexed_multiset;

#define ull unsigned long long
#define ll long long int
#define ld long double
#define MOD 1000000007
#define pi 3.14159265358979323846
#define N 100005
#define sz(x) ((int)(x).size())
#define test ll t; cin >> t; while(t--)
#define all(x) (x).begin(), (x).end()
#define ld long double
#define bigint int64_t
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define mp make_pair
#define pb push_back
#define pll pair<ll,ll>
#define vvll vector<vector<ll>>
#define fi first
#define se second
#define ins insert
#define endl "\n"
#define rep(i,a,n) for(ll (i) = a;(i) < (n); (i)++)
#define repn(i,a,n) for(ll (i) = a;(i) <= (n); (i)++)
#define repr(i,a,n) for(ll (i) = a;(i) >= (n); (i)--)

//-------------------DEBUGGING-----------------------

vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx,
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
//-----------------------------------------------------------------------

// doing the brute
ll sumd(ll n){
	if(n < 0) return -1;
	ll sum = 0;
	while(n){
		sum+=n%10;
		n/=10;
	}
	return sum;
}
void solve(){
	ll a, b, c; cin >> a >> b >> c;
	vll v;
	repn(i,1,81){
		ll eq = (b*pow(i, a)+c);
		ll key = sumd(eq);
		if( key == i && eq < 1e9){
			v.pb(eq);
		}
	}
	cout << sz(v) << endl;
	for(auto it : v) cout << it << ' ';

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    solve();
    return 0;
    }
// Problem : B. Little Dima and Equation
// Contest : Codeforces - Codeforces Round #262 (Div. 2)
// URL : https://codeforces.com/problemset/problem/460/B
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)


#include <bits/stdc++.h>

using namespace std;

int n,b;
int v[110];
int x[110];
int y[110];
int dp[110][110];

int f(int pos, int w) {
    if(pos == n) return 0;
    if(dp[pos][w] != -1) return dp[pos][w];
    int ans = -1e9;
    for (int i = pos; i < n; ++i) {
        int cost = abs(v[i] - v[i + 1]);
        int even = x[i];
        int odd = y[i];
        if(pos) {
            even -= x[pos - 1];
            odd -= y[pos - 1];
        }
        if(even == odd) {
            if(i < n - 1 and w >= cost) ans = max(ans,f(i + 1, w - cost) + 1);
            else ans = max(ans,f(i + 1, w));
        }
    }
    return dp[pos][w] = ans;
}

int main(){
    memset(dp, -1,sizeof dp);

    cin >> n >> b;

    for (int i = 0; i < n; ++i) {
        cin >> v[i];
        if(v[i] & 1) y[i] = 1;
        else x[i] = 1;
    }

    for (int i = 1; i < n; ++i) {
        x[i] += x[i - 1];
        y[i] += y[i - 1];
    }

    cout << f(0,b) << "\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<typename T>
class Modular {

  private:

    using Type = typename decay<decltype(T::value)>::type;
    Type value;

  public:

    Modular() { value = 0; }

    template <typename U>
    Modular(const U& x) { value = normalize(x); }

    template<typename U>
    Type normalize(const U& x) {
        Type res;
        if (-mod() <= x && x < mod()) {
            res = static_cast<Type>(x);
        } else {
            res = static_cast<Type>(x % mod());
        }
        if (res < 0) {
            res += mod();
        }
        return res;
    }

    explicit operator Type() const { return value; }
    template <typename U> explicit operator U() const { return static_cast<U>(value); }
    constexpr static Type mod() { return T::value; }

    Modular power(Modular n, Type x) {
        assert(x >= 0);
        Modular res = 1;
        for (; x; x /= 2, n *= n) if (x & 1) res *= n;
        return res;
    }

    Type inverse(Type a, Type m) {
        Type x = 0, y = 1;
        while (a != 0) {
            Type q = m / a;
            m -= q * a; swap(a, m);
            x -= q * y; swap(x, y);
        }
        assert(m == 1);
        return x;
    }

    Modular& operator+=(const Modular& o) { if ((value += o.value) >= mod()) value -= mod(); return *this; }
    template <typename U> Modular& operator+=(const U& o) { return *this += Modular(o); }

    Modular& operator-=(const Modular& o) { if ((value -= o.value) < 0) value += mod(); return *this; }
    template <typename U> Modular& operator-=(const U& o) { return *this -= Modular(o); }

    Modular& operator*=(const Modular& o) { value = normalize(1ll * value * o.value); return *this; }
    template <typename U> Modular& operator*=(const U& o) { return *this *= Modular(o); }

    Modular& operator/=(const Modular &o) { return *this *= Modular(inverse(o.value, mod())); }
    template <typename U> Modular& operator/=(const U& o) { return *this /= Modular(o); }

    Modular operator+() { return Modular(+value); }
    Modular operator-() { return Modular(-value); }

    Modular& operator++() { return *this += 1; }
    Modular& operator--() { return *this -= 1; }

    friend ostream& operator<<(ostream &os, const Modular &x) { os << x.value; return os; }
    friend istream& operator>>(istream &is, Modular &x) {
        typename common_type<Type, int64_t>::type in;
        is >> in;
        x.value = x.normalize(in);
        return is;
    }

    friend bool operator==(const Modular& a, const Modular& b) { return a.value == b.value; }
    template<typename U> friend bool operator==(const Modular &a, U b) { return a == Modular(b); }
    template<typename U> friend bool operator==(U a, const Modular &b) { return Modular(a) == b; }

    friend bool operator!=(const Modular& a, const Modular& b) { return a.value != b.value; }
    template<typename U> friend bool operator!=(const Modular &a, U b) { return a != Modular(b); }
    template<typename U> friend bool operator!=(U a, const Modular &b) { return Modular(a) != b; }

    friend bool operator>(const Modular& a, const Modular& b) { return a.value > b.value; }
    template<typename U> friend bool operator>(const Modular &a, U b) { return a > Modular(b); }
    template<typename U> friend bool operator>(U a, const Modular &b) { return Modular(a) > b; }

    friend bool operator<(const Modular& a, const Modular& b) { return a.value < b.value; }
    template<typename U> friend bool operator<(const Modular &a, U b) { return a < Modular(b); }
    template<typename U> friend bool operator<(U a, const Modular &b) { return Modular(a) < b; }

    friend bool operator>=(const Modular& a, const Modular& b) { return a.value >= b.value; }
    template<typename U> friend bool operator>=(const Modular &a, U b) { return a >= Modular(b); }
    template<typename U> friend bool operator>=(U a, const Modular &b) { return Modular(a) <= b; }

    friend bool operator<=(const Modular& a, const Modular& b) { return a.value <= b.value; }
    template<typename U> friend bool operator<=(const Modular &a, U b) { return a <= Modular(b); }
    template<typename U> friend bool operator<=(U a, const Modular &b) { return Modular(a) <= b; }

    friend Modular operator+(const Modular &a, const Modular& b) { return Modular(a) += b; }
    template <typename U> friend Modular operator+(const Modular &a, const U& b) { return Modular(a) += Modular(b); }
    template <typename U> friend Modular operator+(const U& a, const Modular &b) { return Modular(a) += b; }

    friend Modular operator-(const Modular &a, const Modular& b) { return Modular(a) -= b; }
    template <typename U> friend Modular operator-(const Modular &a, const U& b) { return Modular(a) -= Modular(b); }
    template <typename U> friend Modular operator-(const U& a, const Modular &b) { return Modular(a) -= b; }

    friend Modular operator*(const Modular &a, const Modular& b) { return Modular(a) *= b; }
    template <typename U> friend Modular operator*(const Modular &a, const U& b) { return Modular(a) *= Modular(b); }
    template <typename U> friend Modular operator*(const U& a, const Modular &b) { return Modular(a) *= b; }

    friend Modular operator/(const Modular &a, const Modular& b) { return Modular(a) /= b; }
    template <typename U> friend Modular operator/(const Modular &a, const U& b) { return Modular(a) /= Modular(b); }
    template <typename U> friend Modular operator/(const U& a, const Modular &b) { return Modular(a) /= b; }

};

constexpr int MOD = 1e9 + 7;
using Mint = Modular<integral_constant<decay<decltype(MOD)>::type, MOD>>;

template<typename T>
class Matrix {

  private:

    vector<vector<T>> M;

  public:

    Matrix() {}

    Matrix(int n, int m) {
        M.assign(n, vector<T>(m, 0));
    }

    size_t size() {
        return M.size();
    }

    vector<T>& operator[](int i) { return M[i]; }
    const vector<T>& operator[](int i) const { return M[i]; }

    friend Matrix operator*(Matrix a, Matrix b) {
        assert(a[0].size() == b.size());
        Matrix res(a.size(), b[0].size());
        for (int i = 0; i < a.size(); i++) {
            for (int j = 0; j < b[0].size(); j++) {
                for (int k = 0; k < b.size(); k++) {
                    res[i][j] += a[i][k] * b[k][j];
                }
            }
        }
        return res;
    }

};

Mint DP(int N, int K, int M) {
    vector<vector<vector<Mint>>> DP(N + 2, vector<vector<Mint>>(K + 2, vector<Mint>(1 << M, 0)));
    DP[0][0][0] = 1;

    for (int n = 0; n < N; n++) { // first n planets
        for (int k = 0; k <= K; k++) { // visited k planets
            for (int mask = 0; mask < (1 << M); mask++) { // last mask planets
                int next_mask = (mask << 1) % (1 << M);

                /* Do not visit n-th planet */
                DP[n + 1][k][next_mask] += DP[n][k][mask];

                /* Visit n-th planet, use combinatorics to count variations regarding mask */
                DP[n + 1][k + 1][next_mask ^ 1] += DP[n][k][mask] * (1 + __builtin_popcount(mask));

            }
        }
    }

    Mint ans = 0;
    for (int mask = 0; mask < (1 << M); mask++) {
        ans += DP[N][K][mask];
    }
    return ans;
}

template<typename T>
T power(T n, long long x) {
    if (x == 1) {
        return n;
    }
    if (x & 1) {
        return n * power(n, x - 1);
    }
    T res = power(n, x / 2);
    return res * res;
}

Mint MatrixExponentiation(int N, int K, int M) {
    vector<vector<int>> name(K + 1, vector<int>(1 << M, -1));
    int cnt = 0;
    for (int k = 0; k <= K; k++) {
        for (int mask = 0; mask < (1 << M); mask++) {
            name[k][mask] = cnt++;
        }
    }

    Matrix<Mint> Transition(cnt, cnt);
    Matrix<Mint> Base(cnt, 1);

    for (int k = 0; k <= K; k++) {
        for (int mask = 0; mask < (1 << M); mask++) {
            int next_mask = (mask << 1) % (1 << M);
            Transition[name[k][next_mask]][name[k][mask]] = 1;
            if (k < K) {
                Transition[name[k + 1][next_mask ^ 1]][name[k][mask]] = 1 + __builtin_popcount(mask);
            }
        }
    }

    Base[name[0][0]][0] = 1;

    Matrix<Mint> ans = power(Transition, N) * Base;
    Mint res = 0;

    for (int mask = 0; mask < (1 << M); mask++) {
        res += ans[name[K][mask]][0];
    }

    return res;
}

int main() {
    int N, K, M;
    cin >> N >> K >> M;

    cout << MatrixExponentiation(N, K, M) << "\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1500, maxm = 1e5, mod = 1e9 + 7;
int n, m, val[maxn + 10], p, tmp, k;
int f[maxn + 10][maxn + 10], sf[maxn + 10][maxn + 10];
int inv[maxm + 10], fac[maxm + 10], ifac[maxm + 10];
int sv[maxn + 10], ssf[maxn + 10][maxn + 10];
int pn[maxm + 10], pm[maxm + 10];

void init() {
	fac[0] = ifac[0] = pn[0] = pm[0] = 1;
	for (int i = 1; i <= maxm; ++i) {
		fac[i] = 1ll * fac[i - 1] * i % mod;
		inv[i] = i == 1 ? 1 : mod - 1ll * (mod / i) * inv[mod % i] % mod;
		ifac[i] = 1ll * ifac[i - 1] * inv[i] % mod;
		pn[i] = 1ll * pn[i - 1] * p % mod;
		pm[i] = 1ll * pm[i - 1] * (mod + 1 - p) % mod;
	}
}

int fpow(int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = 1ll * ans * x % mod;
		y >>= 1; x = 1ll * x * x % mod;
	}
	return ans;
}

inline int comb(int x, int y) {
	return 1ll * fac[x] * ifac[y] % mod * ifac[x - y] % mod;
}

int main() {
	scanf("%d%d%d%d%d", &n, &m, &p, &tmp, &k);
	p = 1ll * p * fpow(tmp, mod - 2) % mod;
	init();
	for (int i = 0; i <= m && i <= k; ++i)
		val[i] = 1ll * comb(k, i) * pn[i] % mod * pm[k - i] % mod;
	for (int i = 0; i <= m; ++i)
		sv[i] = ((i ? sv[i - 1] : 0) + val[i]) % mod;
	for (int i = 1; i <= m; ++i)
		for (int j = 1; j <= i; ++j)
			(f[1][i] += 1ll * val[j - 1] * val[m - i] % mod) %= mod;
	for (int i = 2; i <= n + 1; ++i) {
		for (int j = 1; j <= m; ++j) {
			sf[i - 1][j] = (sf[i - 1][j - 1] + f[i - 1][j]) % mod;
			ssf[i - 1][j] = (ssf[i - 1][j - 1] + 1ll * sf[i - 1][j] * val[j]) % mod;
		}
		for (int j = 1; j <= m; ++j) {
			int w = sf[i - 1][m] - sf[i - 1][m - j];
			if (w < 0) w += mod;
			w = 1ll * w * sv[j - 1] % mod;
			w -= ssf[i - 1][j - 1];
			w = (w % mod + mod) % mod;
			f[i][j] = 1ll * w * val[m - j] % mod;
		}
	}
	printf("%d", sf[n][m]);
}


#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;
#define pb push_back
#define fst first
#define snd second

int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, z = 0;
	for(int i = 0; i < n; i++)
	{
		if(s[i] == '1')  o++;
		else z++;
	}
	if(o == 0)
	{
		cout << 0;
		return 0;
	}
	cout<< 1;
	for(int i = 0; i < z; i++) cout << 0;
}


#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<ctime>
#include<complex>
#include<list>
using namespace std;

int n,m,x1,Y1,x2,Y2;
string a="First",b="Second";

int main(){
	cin>>n>>m>>x1>>Y1>>x2>>Y2;
	if(abs(x1-x2)>=4&&abs(Y1-Y2)>=4) cout<<b<<endl;
	else if(abs(x1-x2)>4||abs(Y1-Y2)>4) cout<<b<<endl;
	else if(abs(x1-x2)==4&&abs(Y1-Y2)==3||abs(Y1-Y2)==4&&abs(x1-x2)==3) cout<<b<<endl;
	else cout<<a<<endl;
	return 0;
}


#include<string.h>
#include<cstring>
#include<iostream>
#include<cstdio>
using namespace std;
int gcd(int a,int b) {
    return b==0?a:gcd(b,a%b);
}
int main() {
    int a,b,x,y;
    while(scanf("%d%d%d%d",&a,&b,&x,&y)!=EOF) {
        int g=gcd(x,y);
        x=x/g;
        y=y/g;
        int mul=min(a/x,b/y);
        printf("%d %d\n",mul*x,mul*y);
    }
    return 0;
}


#include <iostream>
#include <string>

using namespace std ;

int main ()
{
	int da(0),db(0),a(0),b(0);
	cin>>da>>db ;

	if (db-da==0)
	{
		a=da*10 ;
		b=db*10+1;
	}
	else if (db-da==1)
	{
		a=da*10+9;
		b=db*10;
	}
	else if ((da==9)&&(db==1))
	{
		a=da;
		b=10;
	}
	else
	{
		a=-1;
	}
	if (a>0)
	{
		cout<<a<<endl;
		cout<<b<<endl;
	}
	else
	{
		cout<<a<<endl ;
	}

	return 0 ;
}


#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define SZ 666666
int n,t,k;
ll a[SZ],b[SZ],c[SZ],sa[SZ],sb[SZ],sc[SZ];
ll d[235][235][235],g[235][235][235];
inline void cmin(ll&a,ll b)
{if(a>b) a=b;}
int main()
{
	cin>>n>>t>>k; ++n;
	const ll inf=1e18;
	for(int i=1;i<=n;++i)
	{
		if(i==n) a[i]=c[i]=inf;
		else cin>>a[i]>>b[i]>>c[i];
		sa[i]=sa[i-1]+a[i];
		sb[i]=sb[i-1]+b[i];
		sc[i]=sc[i-1]+c[i];
	}
	for(int p=1;p<=n;++p)
		for(int s=0;s<=t;++s)
			for(int z=0;z<2;++z)
			{
				d[p][s][z]=g[p][s][z]=inf;
				if(s*b[p]+z*a[p]<=c[p]
				&&d[p-1][s][z]<inf)
				{
					d[p][s][z]=d[p-1][s][z];
					ll v=(z*sa[p-1]+s*sb[p-1]+k-1)/k;
					if(v*k<=z*sa[p]+s*sb[p])
						g[p][s][z]=v;
				}
				for(int r=0;r<s;++r) if(g[p][r][z]<inf)
				{
					ll m=z*sa[p]+r*sb[p]-k*g[p][r][z];
					ll x=(max(m+(s-r)*b[p]-c[p],0LL)+k-1)/k;
					if(x*k<=m&&d[p-1][s-r][0]<inf)
					{
						cmin(d[p][s][z],g[p][r][z]+x+d[p-1][s-r][0]);
						ll v=((s-r)*sb[p-1]+k-1)/k;
						if(v*k<=(s-r)*sb[p]+m-x*k)
							cmin(g[p][s][z],g[p][r][z]+x+v);
					}
				}
			}
	cout<<d[n][t][1]<<"\n";
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e2+7;
int n,m;
int arr[N] ,  mx , ans2;

bool can(int mid){
  int ret=0;
  for(int i =0 ; i < n ; ++i){
    ret+=(mid-arr[i]);
  }
  return ret>=m;
}

int main(){
  scanf("%d %d",&n,&m);
  for(int i=0 ; i < n ; ++i){
    scanf("%d",arr+i);
    mx=max(mx,arr[i]);
  }
  ans2=mx+m;
  int l=mx , h=ans2+7;
  while(l<h){
    int mid=(l+h)>>1;
    if(can(mid))
      h=mid;
    else
      l=mid+1;
  }
  printf("%d %d",h , ans2);
}


#include<bits/stdc++.h>
#define cs const
using namespace std;
typedef long long ll;
cs int N = 205;
cs ll lim = 1e18 + 1;
int n, m; ll k;
string ans = "", f[15];
bool pre(int pos, cs string &s, int st, int len){
	int id = pos <= 14 ? pos : 14 - (pos&1);
	if(f[id].length() < len) return false;
	for(int i = 0; i < len; i++) if(f[id][i] != s[st + i]) return false;
	return true;
}
bool suf(int pos, cs string &s, int st, int len){
	int id = min(pos, 14);
	if(f[id].length() < len) return false;
	int l = f[id].length();
	for(int i = l - len; i < l; i++) if(f[id][i] != s[st + i - (l - len)]) return false;
	return true;
}
ll calc(int n, cs string &s){
	static ll g[N];
	for(int i = 0; i <= n; i++){
		if(i < 2){ g[i] = f[i] == s; continue; }
		g[i] = g[i - 1] + g[i - 2];
		for(int j = 1, up = s.length(); j < up; j++) if(suf(i - 2, s, 0, j) && pre(i - 1, s, j, up - j)) ++g[i];
		g[i] = min(g[i], lim);
	} return g[n];
}
int main(){
//	freopen("1.in","r",stdin);
	scanf("%d%lld%d", &n, &k, &m);
	f[0] = "0"; f[1] = "1";
	for(int i = 2; i <= 14; i++) f[i] = f[i-2] + f[i-1];
	for(int i = 1; i <= m; i++){
		ll cnt = calc(n, ans + "0");
		ll exi = ans != "" && suf(n, ans, 0, ans.length());
		if(k <= exi) break;
		if(k <= exi + cnt) k -= exi, ans += "0";
		else k -= exi + cnt, ans += "1";
	} cout << ans; return 0;
}


#include<bits/stdc++.h>

#define bit(x, y) (((x)>>(y))&1)
#define bpt(x) (__builtin_popcount(x))

using namespace std;

typedef long long INT;
typedef vector<int> VI;
#define pb push_back

template <class T> inline void gn(T &x) {char c, sg=0; while(c=getchar(), (c>'9' || c<'0') && c!='-'); for((c=='-' ? sg=1, c=getchar() : 0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0'; if(sg) x=-x;}
template <class T1, class T2> inline void gn(T1 &x1, T2 &x2) {gn(x1), gn(x2);}

int power(int a, int b, int m, int ans=1) {
	for (; b; b>>=1, a=1LL*a*a%m) if (b&1) ans=1LL*ans*a%m;
	return ans;
}
#define NN 300100

int st[NN];
VI adj[NN], res[NN], A[NN];
int lena, lenb;
VI Ax, Bx;
int n, m;
int deg[NN];

int get_id() {
	memset(deg, 0, sizeof deg);
	for(int i=1; i<=n; i++) {
		for(auto u : res[i]) {
			deg[u]++;
		}
	}
	int nn = 0;
	Ax.clear();
	for(int i=1; i<=n; i++) if(!deg[i]) Ax.pb(i);
	while(Ax.size()) {
		Bx.clear();
		A[nn].clear();
		for(auto u : Ax) {
			A[nn].pb(u);
			for(auto v : res[u]) {
				deg[v]--;
				if(!deg[v]) Bx.pb(v);
			}
		}
		nn++;
		Ax.clear();
		for(auto u : Bx) Ax.pb(u);
	}
	return nn;
}

int flag[NN];
VI ok[NN];
int cnt[NN];
int vst[NN];

int update(int u) {
	for(auto v : A[u+1]) cnt[v] = 0;
	for(auto v : A[u]) {
		for(auto x : res[v]) {
			cnt[x]++;
		}
	}
	for(auto v : A[u]) {
		vst[v] = 0;
		for(auto x : res[v]) if(cnt[x] == 1) {
			vst[v] = 1;
			break;
		}
	}
}

int solve() {
	memset(vst, 0, sizeof vst);
	int nn = get_id();
	for(int i=0; i<nn-1; i++) update(i);
	memset(flag, 0, sizeof flag);
	memset(cnt, 0, sizeof cnt);
	for(int i=nn-1; i>=0; i--) {
		for(auto u : A[i]) {
			if(st[u] == -1) continue;
			if(A[i].size() > 2) {
				st[u] = -1;
				continue;
			}
			for(auto v : A[i]) if(v != u) ok[u].pb(v);
			if(i == nn-1) continue;
			int s = 0;
			for(auto v : A[i+1]) flag[v] = 0;
			for(auto v : res[u]) {
				flag[v] = 1;
			}
			for(auto v : A[i+1]) if(!flag[v]) s++;
			if(s >= 2) st[u] = -1;
			else if(s == 1) {
				for(auto v : A[i+1]) if(!flag[v]){
					if(vst[v]) st[u] = -1;
					else ok[u].pb(v);
				}
			}
		}
	}
	return nn;
}
VI IDA;
VI IDB;
int id[NN];
VI b[NN];

int calc_lt(int u) {
	int x = -1;
	for(; u; u-=u&-u) if(b[u].size()){
		if(b[u].size() > 1) return 0;
		if(x > 0) return 0;
		x = b[u][0];
	}
	return x;
}

int calc_rt(int u) {
	int x = -1;
	for(; u<NN; u+=u&-u) if(b[u].size()){
		if(b[u].size() > 1) return 0;
		if(x > 0) return 0;
		x = b[u][0];
	}
	return x;
}

int update_lt(int u, int val) {
	for(; u; u-=u&-u) {
		if(b[u].size() > 1) continue;
		b[u].pb(val);
	}
}

int update_rt(int u, int val) {
	for(; u<NN; u+=u&-u) {
		if(b[u].size() > 1) continue;
		b[u].pb(val);
	}
}

int check_final() {
	for(int i=0; i<IDB.size(); i++) {
		int u = IDB[i];
		id[u] = i+1;
	}
	for(int i=0; i<NN; i++) b[i].clear();
	for(int i=0; i<IDA.size(); i++) {
		int v = IDA[i];
		int x = calc_rt(id[v]);
		if(x == 0) st[v] = -1;
		if(x > 0) ok[v].pb(x);
		update_lt(id[v], v);
	}
	for(int i=0; i<NN; i++) b[i].clear();
	for(int i=IDA.size()-1; i>=0; i--) {
		int v = IDA[i];
		int x = calc_lt(id[v]);
		if(x == 0) st[v] = -1;
		if(x > 0) ok[v].pb(x);
		update_rt(id[v], v);
	}
	for(int i=1; i<=n; i++) {
		sort(ok[i].begin(), ok[i].end());
		ok[i].resize(unique(ok[i].begin(), ok[i].end())-ok[i].begin());
		if(ok[i].size() > 1) st[i] = -1;
	}
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	gn(n, m);
	for(int i=1; i<=n; i++) st[i] = 1;
	for(int i=1; i<=m; i++) {
		int u, v;
		gn(u, v);
		adj[u].pb(v);
	}
	for(int i=1; i<=n; i++) res[i] = adj[i];
	int nn = solve();
	for(int i=0; i<nn; i++) {
		for(auto u : A[i]) {
			IDA.pb(u);
		}
	}
	for(int i=1; i<=n; i++) res[i].clear();
	for(int i=1; i<=n; i++) {
		for(auto u : adj[i]) {
			res[u].pb(i);
		}
	}
	nn = solve();
	for(int i=nn-1; i>=0; i--) {
		for(auto u : A[i]) {
			IDB.pb(u);
		}
	}
	check_final();
	int ans = 0;
	for(int i=1; i<=n; i++) if(st[i] == 1) ans++;
	printf("%d\n", ans);
}


#include<bits/stdc++.h>
using namespace std;

#define int long long
#define fi first
#define se second
#define pb push_back

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;

const int N = 1e6 + 3;

int a, b, p, x, sum;
vector<int> ck[N];

int binpw(int base, int pw, int mod){
	int ans = 1;
	while(pw){
		if(pw & 1) ans = (ans * base) % mod;
		base = (base * base) % mod;
		pw >>= 1;
	}
	return ans;
}

int find(int a, int b){// % p = a, % (p - 1) = b
	if(a < b) return (b - a) * (p - 1) + b;
	else if(a == b) return a;
	else return (p * (p - 1)) - find(p - a, p - 1 - b);
}

signed main(){
	ios_base::sync_with_stdio(0);
	cin >> a >> b >> p >> x;
	for(int i = 0; i < p - 1; i++) ck[binpw(a, i, p)].pb(i);
	for(int i = 0; i < p; i++){
		if(b && !i) continue;
		int temp = b * binpw(i, p - 2, p) % p;
		//cout << i << " " << temp << "\n";
		if(!ck[temp].size()) continue;
		for(int j = 0; j < ck[temp].size(); j++){
			//cout << ck[temp][j] << " " << i << " ";
			int temp2 = find(i, ck[temp][j]);
			//cout << temp2 << "\n";
			if(!temp2) temp2 += p * (p - 1);
			sum += x / (p * (p - 1));
			int temp3 = x % (p * (p - 1));
			sum += (temp3 >= temp2);
		}
	}
	cout << sum;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
cout<<((n%2)?"black":"white\n");
if(n%2==0)
    cout<<"1 "<<2<<endl;

return 0;}


#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define REPC(I, C) for (int I = 0; !(C); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
struct data{
    int p,e;
    bool operator<(const data& b)const{
        return e<b.e||(e==b.e&&p>b.p);
    }
}a[200010];
int yo[200010],yon;
void fresh(long long& x,long long v){
    if(x==-1||x>v)x=v;
}
int err[2][200010];
int main(){
    DRII(n,k);
    int win=n+1-k;
    REP(i,n){
        scanf("%d%d",&a[i].p,&a[i].e);
        yo[yon++]=a[i].p;
    }
    if(win==0){
        puts("0");
        return 0;
    }
    sort(yo,yo+yon);
    sort(a,a+n);
    long long an=-1;
    int low=0,st=200004;
    REPP(i,1,200001){
        while(low<n&&yo[low]<=i)low++;
        if(low>=win){
            st=i;
            break;
        }
    }
    for(int i=0;i<20;i++,st++){
        if(st<1)continue;
        if(st>n)break;
        long long v=0;
        int ha=0;
        int en1=0,en2=0;
        REP(j,st){
            v+=a[j].e;
            if(a[j].p<=st)ha++;
            if(a[j].p<=st-2||a[j].p>st)err[0][en1++]=a[j].e;
        }
        REPP(j,st,n){
            if(a[j].p<=st-2)ha++;
            else if(a[j].p<=st){
                err[1][en2++]=a[j].e;
            }
        }
        if(ha+min(en1,en2)<win)continue;
        REP(j,win-ha)v+=err[1][j]-err[0][en1-1-j];
        fresh(an,v);
    }
    cout<<an<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define AC return
#define Please 0
#define itn int
#define enld '\n'       //IO?
#define endl '\n'       //IO?
#define Endl '\n'       //IO?
#define esle else
#define ciN cin
#define YES "YES"
#define NO "NO"
#define eb emplace_back
#define wide(x,ch) setw(x)<<setfill(ch)
#define show "ans-------------> "<<
class MyCpiise{public:bool operator()(pair<int,int> a,pair<int,int> b){return a.second<b.second;}};
MyCpiise Mcse;
#define dbg(x...) do{cout<<#x<<" -> ";err(x);}while (0)
void err(){cout<<'\n';}
template<class T, class... Ts>
void err(T arg, Ts... args) {
    cout<<arg<< ' ';
    err(args...);
}
template<typename T>
T read(T judge){
    T x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9') {if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9') x=(x<<1)+(x<<3)+c-'0',c=getchar();
    return f*x;
}
inline void reads(){return;}
template<class T,class... Ts>
inline void reads(T &x,Ts&... xs) {
    x=0;
    char c=getchar();
    while('0'<=c&&c<='9') {
        x=(x<<3)+(x<<1)+(c^48);
        c=getchar();
    }
    reads(xs...);
}
template<typename T>
void print(T x){
    if (x<0) putchar('-'),x=-x;
    if (x/10) print(x/10);
    putchar(x%10+'0');
}
mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
long long rng(long long l, long long r) {
    uniform_int_distribution<long long> uni(l, r);
    return uni(mt);
}

#define int long long                        //int main()->signed main()?
#define INF 0x3f3f3f3f
#define LLINF 9223372036854775807
#define pii pair<int,int>
#define pip pair<int,pii >
#define ppi pair<pii ,int>
#define ppp pair<pii ,pii >
const int MOD1=998244353;
const int MOD2=1e9+7;
const int N4=1e4+10;
const int N5=1e5+10;
const int NN5=2e5+10;
const int N6=1e6+10;
const int N7=1e7+10;
const int N8=1e8+10;
const int N9=1e9+10;
int dr[4]={0,1,0,-1};
int dc[4]={1,0,-1,0};
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define is_odd(x) (x&1)
#define lowbit(x) (x&(-x))
void bin_print(int now,int cnt){
    if(!cnt) return;
    bin_print(now>>1,cnt-1);
    cout<<(now&1);
}
int fast_pow(int x,int n=MOD2-2,int mod=MOD2,int ret=1){
    while(n){
        if(n&1) ret=ret*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return ret;
}
long long fast_ll_pow(long long x,long long n,long long ret=1){
    while(n){
        if(n&1) ret=ret*x;
        x=x*x;
        n>>=1;
    }
    return ret;
}
int exgcd(int a,int b,int &x,int &y){
    if(!b){x=1;y=0;return a;}
    else{int ret=exgcd(b,a%b,y,x);y-=a/b*x;return ret;}
}
int lcm(int a,int b){return a*b/__gcd(a,b);}
typedef long long ll;

void run()
{
    int n,m,k;
    cin>>n>>m>>k;
    if(n&1){
        int r=m/2;
        if(k<r) return (void)(cout<<NO<<endl);
        k-=r;
        n--;
    }
    if(k>(m/2)*n) return (void)(cout<<NO<<endl);
    if(k&1) cout<<NO<<endl;
    else cout<<YES<<endl;

/*------------------------dbg----------------------------*/

    return;
    //T==1?
}
signed main()
{
//    freopen("D:\\MY_std_input\\std_input.txt", "r", stdin);
//    freopen("D:\\MY_std_input\\std_output1.txt", "w", stdout);
//    freopen("D:\\MY_std_input\\std_output2.txt", "w", stdout);
//    system("cls");
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
        run();
    }

    AC Please;
}
// "str.size()-num" --> "(int)str.size()-num" ?


// Build DAG by adding single vertices.
// If we add vertex i, we can't add any vertex < i
// until there is an edge to it from vertex i or any later added vertex.
// States of DP: (added vertices, candidates for next added). O(4^N).
#include <bits/stdc++.h>
using namespace std;

struct state {
	int candidates;
	int cnt, sum;
	constexpr static int mod = 998244353;

	state() = default;
	state(int candidates_, int cnt_, long long sum_)
		: candidates(candidates_), cnt(cnt_), sum(sum_ % mod) {}

	inline state & operator+=(const state & S) {
		cnt += S.cnt;
		if(cnt >= mod) cnt -= mod;
		sum += S.sum;
		if(sum >= mod) sum -= mod;
		return *this;
	}

	bool operator<(const state & S) const {
		return candidates < S.candidates;
	}
};

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	int N, M;
	cin >> N >> M;
	vector<int> E(N, 0), Ei(N, 0), E_all(N, 0);
	for(int i = 0; i < M; i++) {
		int u, v;
		/* rand */
		// static mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
		// u = rng()%N, v = rng()%N;
		// while(u == v || (E_all[u]>>v)&1)
		// 	u = rng()%N, v = rng()%N;
		/* rand */
		/* input */
		cin >> u >> v;
		u--, v--;
		/* input */
		E[u] |= 1<<v;
		Ei[v] |= 1<<u;
		E_all[u] |= 1<<v;
		E_all[v] |= 1<<u;
	}

	vector< vector<state> > dp(1<<N);
	// dp[0].push_back({(1<<N)-1, 1});
	dp[0].push_back({(1<<N)-1, 1, 0});
	for(int used = 0; used < (1<<N); used++) {
		sort(begin(dp[used]), end(dp[used]));
		int pos = 0;
		for(int i = 1; i < (int)dp[used].size(); i++) {
			if(dp[used][i].candidates == dp[used][pos].candidates) {
				dp[used][pos] += dp[used][i];
				continue;
			}
			pos++;
			dp[used][pos] = dp[used][i];
		}
		if(!dp[used].empty()) {
			dp[used].resize(pos+1);
		}
		for(state & st : dp[used]) {
			int suf = (1<<N)-1;
			for(int j = 0; j < N; j++) {
				suf ^= (1<<j);
				if(((st.candidates)>>j)&1) {
					int next_used = used | (1<<j);
					int next_candidates = (st.candidates & suf) | E_all[j];
					next_candidates ^= (next_candidates & next_used);
					long long num_reversed = __builtin_popcount(used & E[j]);
					dp[next_used].push_back({next_candidates, st.cnt, st.sum + st.cnt * num_reversed});
				}
			}
		}
	}

	int num_states = 0;
	for(int i = 0; i < (1<<N); i++) num_states += dp[i].size();
	cerr << num_states << "\n";

	long long ans_sum = 0, ans_cnt = 0;
	for(state & st : dp[(1<<N)-1]) {
		// ans_cnt += st.cnt;
		ans_sum += st.sum;
	}
	// ans_cnt %= state::mod;
	ans_sum %= state::mod;
	// ans_sum = ans_cnt * M % state::mod;
	// ans_sum = ans_sum * pow(2, state::mod-2, state::mod) % state::mod;
	// cout << ans_cnt << "\n";
	cout << ans_sum << "\n";
	return 0;
}


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

int main()
{

long long a,b;

cin>>a>>b;
int count=0;
bool f=0;

for(long long k=a;k<=b;k++)
{
    for(long long j=k+1;j<=b;j++)
    {
        for(long long i=j+1;i<=b;i++)
        {

    long long d1=std::__gcd(i,j);
    long long d2=std::__gcd(j,k);
    long long d3=std::__gcd(i,k);
    if ( ( d1==d2) && ( d2!=d3) )
    {   cout<<k<<" "<<j<<" " <<i<<endl; return 0;}

        }
}
    if(f)break;
}

if(f==0)cout<<-1<<endl;

    return 0;
}


#include <iostream>
#include <string>

inline bool is_upper(char c) {
    return c >= 'A' && c <= 'Z';
}

char to_upper(char c) {
    if (is_upper(c))
        return c;
    return c - 'a' + 'A';
}

char to_lower(char c) {
    if (!is_upper(c))
        return c;
    return c - 'A' + 'a';
}

int main() {
    std::string s;
    std::cin >> s;

    int numLowerCase, numUpperCase;
    numLowerCase = numUpperCase = 0;
    for (size_t i = 0; i < s.size(); ++i) {
        char c = s[i];
        if (is_upper(c)) {
            ++numUpperCase;
        } else {
            ++numLowerCase;
        }
    }

    if (numUpperCase > numLowerCase) {
        for (size_t i = 0; i < s.size(); ++i)
            std::cout << to_upper(s[i]);
    } else {
        for (size_t i = 0; i < s.size(); ++i)
            std::cout << to_lower(s[i]);
    }

    std::cout << std::endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

char grid[502][502];
int t, n, k, vis[502][502];
vector<int> cntCells;

bool valid(int x, int y) {
    return (x && y && x <= n && y <= n && grid[x][y] != 'X' && vis[x][y] == -1);
}

void DFS(int x, int y) {
    vis[x][y] = t;
    cntCells[t]++;
    if (valid(x-1,y)) DFS(x-1,y);
    if (valid(x+1,y)) DFS(x+1,y);
    if (valid(x,y-1)) DFS(x,y-1);
    if (valid(x,y+1)) DFS(x,y+1);
}

void findCC() {
    t = 0;
    memset(vis,-1,sizeof vis);
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (valid(i,j)) {
                cntCells.push_back(0);
                DFS(i,j);
                t++;
            }
        }
    }
}

int main() {
    int res = 0;
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; i++) {
        cin.ignore();
        for (int j = 1; j <= n; j++) {
            scanf("%c", &grid[i][j]);
        }
    }
    findCC();
    int vs[cntCells.size()+1] = {0};
    // pre-processing
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= k; j++) {
            if (vis[i][j] != -1) cntCells[vis[i][j]]--;
        }
    }

    for (int i = 1; i+k-1 <= n; i++) {
        if (i&1) {
            // Pre-processing Vertically
            for (int u = 1; u <= k && i != 1; u++) {
                if (grid[i-1][u] == '.') cntCells[vis[i-1][u]]++;
                if (grid[i+k-1][u] == '.') cntCells[vis[i+k-1][u]]--;
            }

            for (int j = 1; j+k-1 <= n; j++, t++) {
                int tmp = k*k;

                // Pre-processing Horizontally
                if (j != 1) {
                    for (int u = i; u < i+k; u++) {
                        if (grid[u][j-1] == '.') cntCells[vis[u][j-1]]++;
                        if (grid[u][j+k-1] == '.') cntCells[vis[u][j+k-1]]--;
                    }
                }

                // Check for components at borders & add their counts
                for (int u = 0; u < k; u++) {
                    if (vis[i-1][j+u] != -1 && vs[vis[i-1][j+u]] != t) {tmp += cntCells[vis[i-1][j+u]]; vs[vis[i-1][j+u]] = t;}
                    if (vis[i+k][j+u] != -1 && vs[vis[i+k][j+u]] != t) {tmp += cntCells[vis[i+k][j+u]]; vs[vis[i+k][j+u]] = t;}
                    if (vis[i+u][j-1] != -1 && vs[vis[i+u][j-1]] != t) {tmp += cntCells[vis[i+u][j-1]]; vs[vis[i+u][j-1]] = t;}
                    if (vis[i+u][j+k] != -1 && vs[vis[i+u][j+k]] != t) {tmp += cntCells[vis[i+u][j+k]]; vs[vis[i+u][j+k]] = t;}
                }

                // Maximize
                res = max(res, tmp);
            }
        } else {

            // Pre-processing Vertically
            for (int u = n-k+1; u <= n; u++) {
                if (grid[i-1][u] == '.') cntCells[vis[i-1][u]]++;
                if (grid[i+k-1][u] == '.') cntCells[vis[i+k-1][u]]--;
            }

            for (int j = n-k+1; j > 0; j--, t++) {
                int tmp = k*k;

                // Pre-processing Horizontally
                if (j != n-k+1) {
                    for (int u = i; u < i+k; u++) {
                        if (grid[u][j] == '.') cntCells[vis[u][j]]--;
                        if (grid[u][j+k] == '.') cntCells[vis[u][j+k]]++;
                    }
                }

                // Check for components at borders & add their counts
                for (int u = 0; u < k; u++) {
                    if (vis[i-1][j+u] != -1 && vs[vis[i-1][j+u]] != t) {tmp += cntCells[vis[i-1][j+u]]; vs[vis[i-1][j+u]] = t;}
                    if (vis[i+k][j+u] != -1 && vs[vis[i+k][j+u]] != t) {tmp += cntCells[vis[i+k][j+u]]; vs[vis[i+k][j+u]] = t;}
                    if (vis[i+u][j-1] != -1 && vs[vis[i+u][j-1]] != t) {tmp += cntCells[vis[i+u][j-1]]; vs[vis[i+u][j-1]] = t;}
                    if (vis[i+u][j+k] != -1 && vs[vis[i+u][j+k]] != t) {tmp += cntCells[vis[i+u][j+k]]; vs[vis[i+u][j+k]] = t;}
                }

                // Maximize
                res = max(res, tmp);
            }
        }
    }
    printf("%d", res);
}


/* NOOB CODER */
//I think of what the world could be, A vision of the one I see, A million dreams is all it's gonna take.

#include<bits/stdc++.h>
using namespace std;

#define                F first
#define                pb(x) push_back(x)
#define                S second
#define                rep(i,a,b) for(int i=a; i<b; ++i)
#define                ne "\n"
#define                ns " "
#define                all(x) (x).begin(), (x).end()
#define                MAX 1000006
#define                MIN -1000006
#define                ll long long int
#define                time cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
#define                GO_CORONA_GO ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
ll gcd(ll a,ll b){while(b){ll x=a%b;a=b;b=x;}return a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

bool isPrime(ll n)
{

    if (n <= 1)
        return false;

    for (ll i = 2; i <=sqrt(n); i++)
        if (n % i == 0)
            return false;

    return true;
}

int setbit(int n){int c;while(n){c+= n & 1;n>>= 1;}return c;}
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
const int N = 300050;
const int maxN = 5e5 + 5;
ll poww(ll a, ll b)
{
    ll res = 1;
    for(int i = 1; i<=b; ++i)
        res *= a;

    return res;
}

int main()
{
    GO_CORONA_GO

    int tt=1;
    //cin>>tt;

    while(tt--)
    {
        int n;cin>>n;
        if(n==0)
            cout<<"O-|-OOOO";
        while(n){
              int x=n%10;

     if (x<5)cout<<"O-|";else {x-=5;cout<<"-O|";}
     for (int i=0;i<x;i++)
     cout<<"O";
     cout<<"-";
     for (int i=x+1;i<5;i++)
     cout<<"O";
     cout<<endl;
     n=n/10;
        }

    }

    }


#include <cstdio>
#include <cstring>
#include <algorithm>
#include <climits>
#include <string>
#include <iostream>
#include <map>
#include <cstdlib>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include<math.h>
using namespace std;
int n,k,x;
int gao(int ans,int a[])
{
    int vis[111];
    int sum=0;
    int b[200];
    for(int i=0;i<ans;i++)
        b[i]=a[i];b[ans]=x;
    for(int i=ans+1;i<=n;i++)
        b[i]=a[i-1];
    int flag=1;
    int ret=n+1;
    while(flag){
        memset(vis,0,sizeof(vis));
        flag=0;int cnt=1;
        for(int i=0;i<ret-1;){
            int sign=i;
            while(i<ret-1&&b[i]==b[i+1]) i++,cnt++;
            if(cnt>=3){
                flag=1;for(int j=sign;j<=i;j++)  vis[j]=1,sum++;
            }
            cnt=1;
            i++;
        }
        int gg=0;
        for(int i=0;i<ret;i++)
            if(!vis[i]) b[gg++]=b[i];
        ret=gg;
    }
    return sum;
}
int main()
{
    int a[111];
    scanf("%d%d%d",&n,&k,&x);
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);
    int Max=0;
    for(int i=0;i<n;i++)
        Max= max ( Max, gao(i,a));
    if(Max==0) cout<<0<<endl;
    else cout<<Max-1<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b)
{
    if(b==0)
    {
        return a;
    }
    return gcd(b, a%b);
}
long long int gcdi(long long int a, long long int b)
{
    if(a<b)
    {
        return gcd(b, a);
    }
    else
    {
        return gcd(a, b);
    }
}
int main()
{
    long long int num, a, b, ac, bc;
    cin>>num>>a>>b>>ac>>bc;
    long long int net=a*b;
    long long int anet=num/a;
    long long int sub=(gcdi(a, b)*num)/net;
    long long int bnet=num/b;
    if(ac>bc)
    {
        bnet-=sub;
    }
    else
    {
        anet-=sub;
    }
    long long int ans=(anet*ac) + (bnet*bc);
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const int M = 10000;

signed main() {
    iostream::sync_with_stdio(false);
    int n, px;
    string py;
    cin>>n>>px>>py;

    while(py.size()!=5) {
        py.push_back('0');
    }

    int p = px*M + stoi(py.substr(1));

    int tot = (n*(n-1)*(n-2))/6;
    for(int m=0; m<=n; m++) {
        int cur = 2*(m*(m-1)*(m-2))/6;
        cur += 2*((m*(m-1))/2)*(n-m);
        cur += (m*(n-m)*(n-m-1)/2);
        if(cur*M/2 >= p*tot) {
            cout<<m<<endl;
            return 0;
        }
    }
    assert(false);
}


#include <iostream>
#include<string>
using namespace std;

bool check(unsigned long z, unsigned long f, string x, string y)
{
    if(f!=z)
        return false;

    for(int i=0; i<z; i++)
        if(toupper(x.at(i))!= toupper(y.at(((f-1)-i))))
            return false;

    return true;
}

int main() {
    string x;
    string y;
    unsigned long z,f;
    cin>>x;
    cin>>y;
    z = x.length();
    f = y.length();

    if ( check(z,f,x,y) == true )
        cout<<"YES";
    else
        cout<<"NO";
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
int sum,n;
signed main(){
	scanf("%lld",&n);
	sum=n;	//sum初始化为n

	sum-=n/2;sum-=n/3;sum-=n/5;sum-=n/7;
	//第一部分 减去1个数

	sum+=n/6;sum+=n/10;sum+=n/14;sum+=n/15;sum+=n/21;sum+=n/35;
	//第二部分 加上2个数

	sum-=n/30;sum-=n/42;sum-=n/70;sum-=n/105;
	//第三部分 减去3个数

	sum+=n/210;
	//最后一步 加上4个数

	printf("%lld",sum);
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
using namespace std;

char a[101];
int b[101]={0},sum=0,ans=0;

int main()
{
	cin>>a;
	for(int i=1;i<=strlen(a);i++)
	{
		if(a[i-1]=='Q')
		{
			sum++;
			b[i]=b[i-1]+1;
		}
		else b[i]=b[i-1];
	}
	for(int i=0;i<strlen(a);i++)
	{
		if(a[i]=='A')
		{
			ans+=b[i]*(sum-b[i]);
		}
	}
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,m,h;
    cin>>n>>h>>m;
    int arr[n+3]={0};
    for(int i=1;i<=n;i++)
      arr[i]=654;
    for(int i=0;i<m;i++)
    {
        int l,r,x;cin>>l>>r>>x;
        for(int  j=l;j<=r;j++)
        {
            if(arr[j]>x)
                arr[j]=x;
        }

    }
    for(int i=1;i<=n;i++)
        if(arr[i]==654)
          arr[i]=h;
    sort(arr,arr+n);
    long long int sum=0;
//for(int i=1;i<=n;i++)
 //       cout<<arr[i]<<endl;
    for(int i=n;i>=1;i--)
    {
        sum+=arr[i]*arr[i];
    }
    cout<<sum<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,m,p,v;
    cin>>n>>m;

    if(n<m)
    {
        int temp=n;
        n=m;
        m=temp;
    }

    p=n-1;
    v=m;

    cout<<p<<" "<<v<<endl;

    return 0;
}


#include<cstdio>
#include<cctype>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<cassert>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<vector>
#include<string>
#include<bitset>
#include<list>
#include<deque>
#include<stack>
#include<queue>
#include<set>
#include<map>

#define inf 1<<30
#define pi acos(-1.0)
#define in(a) scanf("%lld",&a)
#define FOR(a,b,c) for(a=b;a<=c;a++)
#define ROF(a,b,c) for(a=c;a>=1;a--)
#define For(a,b,c) for(a=b;a<c;a++)
#define roF(a,b,c) for(a=c-1;a>=0;a--)
#define rep(i,a,b,c) for(i=a;i<=b;i+=c)
#define mm(arr,x) memset(arr,x,sizeof(arr))
#define pf printf
#define fin freopen("in.txt","r",stdin)
#define fout freopen("out.txt","w",stdout)
#define pb push_back
#define sq(x) ((x)*(x))
#define Sqrt(n) (long long)round(sqrt((double)n))
#define logg(x,y) (double)log(y)/(double)log(x)
#define cl clear()
#define ps push
#define mod 1000000007
#define mid (lo+hi)/2
#define LEFT node*2
#define RIGHT (node*2)+1

using namespace std;
typedef long long ll;
typedef string S;
typedef double D;

vector<S>v;
vector<ll>vv;

ll arr[100005];

ll attoi(S s)
{
    ll len=s.length(),x=0;
    for(ll i=len-1;i>=0;i--)
    {
        x=x*10+s[i]-'0';
    }
    return x;
}

void call(S s,ll pos,ll len)
{
    if(pos==len/2)
    {
        for(ll i=0;i<(len/2);i++)
        {
            char c=s[pos-i-1];
            s+=c;
        }
        v.pb(s);
        return;
    }
    ll start=0;
    if(pos==0)
        start=1;
    for(ll i=start;i<=9;i++)
    {
        char c='0'+i;
        call(s+c,pos+1,len);
    }
    return;
}

int main()
{
    ll i,j,k,n,m,x,cnt=0,count=0,t,y,p,q,maxx=0,minn=1<<30,a,b,test=0,len,sum=0,c;
    string s,s1,s2;
    s.clear();
    call(s,0,2);
    call(s,0,4);
    call(s,0,6);
    call(s,0,8);
    call(s,0,10);
    v.pb("100000000001");
    ll sz=v.size();
    for(i=0;i<sz;i++)
    {
        s=v[i];
        x=attoi(s);
        arr[i]=x;
    }

    sort(arr,arr+sz);

    in(n),in(m);

    for(i=1;i<n;i++)
    {
        arr[i]=(arr[i-1]+arr[i])%m;
        sum=arr[i];
    }
    pf("%lld\n",arr[n-1]%m);
}


#include <bits/stdc++.h>

using namespace std;

#define fo(i, a, b) for(int i = a; i <= b; i++)
#define _fo(i, a, b) for(int i = a; i >= b; i--)
#define sz(a) ((int) a.size())
#define all(a) begin(a), end(a)
#define fi first
#define se second
#define pb(x) push_back(x)
#define mk(x, y) make_pair(x, y)

typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int MAX = 1e5+5;
const int MOD = 1e9+7;
const ll INF = INT_MAX;
const ll _INF = INT_MIN;

ll lcm(ll a, ll b) {
	return (a*b) / __gcd(a, b);
}

signed main() {
	ll c;
	pll candy[2];

	cin >> c >> candy[0].fi >> candy[1].fi >> candy[0].se >> candy[1].se;

	bool opt = (candy[0].fi*candy[1].se < candy[1].fi*candy[0].se);
	bool mxw = (candy[0].se < candy[1].se);
	ll d = lcm(candy[0].se, candy[1].se);

	ll ans = 0;
	fo(i, 0, 2) {
		ll temp = (c%d) + i*d;
		if(temp > c) break;
		for(ll j = 0; candy[mxw].se*j <= min(temp, d-1); j++)
			ans = max(ans, candy[opt].fi*(c-temp)/candy[opt].se + candy[mxw].fi*j + candy[(mxw^1)].fi*min(d/candy[(mxw^1)].se-1, (temp-candy[mxw].se*j)/candy[(mxw^1)].se));
	}

	cout << ans;
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6;
const int lim=1e6+5;
const int P=1e9+7;
int inv[lim],f[lim];
bool vis[lim];
vector<int>fac[lim];
int g[lim],cnt[lim];
int x;
int n,q,k;
int ans=0;
inline int C(int n,int m){
	if(m>n)return 0;
	return 1ll*f[n]*inv[m]%P*inv[n-m]%P;
}
void update(){
	for(auto i:fac[x]){
		ans=(ans+1ll*g[i]*C(cnt[i],k-1)%P)%P;
		cnt[i]++;
	}
}
inline int qpow(int a,int b){
	int res=1;
	while(b){
		if(b&1){
			res=1ll*res*a%P;
		}
		a=1ll*a*a%P;
		b>>=1;
	}
	return res;
}
signed main()
{
	for(int i=1;i<=N;i++){
		g[i]=i;
	}
	for(int i=1;i<=N;i++){
		fac[i].push_back(i);
		for(int j=i+i;j<=N;j+=i){
			fac[j].push_back(i);
			g[j]-=g[i];
		}
	}
	f[0]=1;
	for(int i=1;i<=N;i++){
		f[i]=1ll*i*f[i-1]%P;
	}
	inv[N]=qpow(f[N],P-2);
	for(int i=N-1;i>=0;i--){
		inv[i]=1ll*inv[i+1]*(i+1)%P;
	}
	scanf("%d%d%d",&n,&k,&q);
	for(int i=0;i<n;i++){
		scanf("%d",&x);
		update();
	}
	while(q--){
		scanf("%d",&x);
		update();
		printf("%d\n",(ans%P+P)%P);
	}
}


#include<bits/stdc++.h>
#define x   first
#define y   second
using namespace std;
typedef pair<int,int> ii;
const char leta='a';
const char letb='b';
const char win[]="FIRST";
const char draw[]="DRAW";
const char lose[]="SECOND";
const int INF=7e3;
char board[23][23];
int n;
int f[41][(1<<20)+7];
bool c[41][(1<<20)+7];
int dx[]={0,1};
int dy[]={1,0};
int diagsize(const int &id) {
	if (id<n) return (id+1);
	else return (2*n-1-id);
}
int diagpos(const int &x,const int &y) {
	if (x+y<n) return (x); else return (n-1-y);
}
ii diagadd(const int &id,const int &pos) {
	assert(pos<diagsize(id));
	if (id<n) return (ii(pos,id-pos));
	else return (ii(id+pos+1-n,n-1-pos));
}
void minimize(int &x,const int &y) {
	if (x>y) x=y;
}
void maximize(int &x,const int &y) {
	if (x<y) x=y;
}
void init(void) {
	scanf("%d",&n);
	int i;
	for (i=0;i<n;i=i+1) scanf("%s",board[i]);
}
int count(int id,int state) {
	assert(state>0);
	if (c[id][state]) return (f[id][state]);
	if (id==2*n-2) return (0);
	if (id%2==0) f[id][state]=INF;
	else f[id][state]=-INF;
	int next[30];
	memset(next,0,sizeof next);
	int i,j,vx,vy;
	ii p;
	for (i=0;i<diagsize(id);i=i+1)
		if ((state|(1<<i))==state) {
			p=diagadd(id,i);
			for (j=0;j<2;j=j+1) {
				vx=p.x+dx[j];
				vy=p.y+dy[j];
				next[board[vx][vy]-'a']=next[board[vx][vy]-'a']|(1<<diagpos(vx,vy));
			}
		}
	for (i='a';i<='z';i=i+1)
		if (next[i-'a']>0) {
			if (id%2==0) minimize(f[id][state],count(id+1,next[i-'a'])+(i==leta)-(i==letb));
			else maximize(f[id][state],count(id+1,next[i-'a'])+(i==leta)-(i==letb));
		}
	c[id][state]=true;
	assert(f[id][state]<INF);
	assert(f[id][state]>-INF);
	//printf("f(%d,%d)=%d\n",id,state,f[id][state]);
	return (f[id][state]);
}
void process(void) {
	int res=count(0,1)+(board[0][0]==leta)-(board[0][0]==letb);
	if (res>0) printf("%s",win);
	if (res<0) printf("%s",lose);
	if (res==0) printf("%s",draw);
}
int main(void) {
	init();
	process();
	return 0;
}


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

int main( ){
	int n, t;
	std::cin >> n >> t;
	std::string s;
	std::cin >> s;
	char c;
	bool is_used = false;
	for (int i = 0; i < t; ++i){
		for (int j = s.size() - 1; j >= 1; --j){
			if (is_used){
				is_used = false;
				continue;
			}
			if (s[j] == 'G' && s[j - 1] == 'B'){
				c = s[j];
				s[j] = s[j - 1];
				s[j - 1] = c;
				is_used = true;
			}
		}
	}
	std::cout << s;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

typedef long long int lli;
typedef long double ld;
typedef pair<lli, lli> plli;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef vector<pair<lli, lli> > vplli;
typedef vector<lli> vlli;
typedef vector<vlli> vvlli;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;

#define PI 3.141592653589793
#define mod (lli)(1000*1000*1000+7)

template<typename T> T gcd(T a, T b) { if (a == 0) return b; return gcd(b % a, a); }
template<typename T> T pow(T a, T b, lli m) {T ans = 1; while (b > 0) { if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m; b /= 2; a = ((a % m) * (a % m)) % m; } return ans % m; }

int main(){
	lli n, m;
	cin>>n>>m;
	lli cnt = 0;
	for(lli i = 1 ; i <= m ; i++){
		for(lli j = i ; j <= m ; j++){
			if((i*i+j*j)%m == 0){
				if(i==j) cnt++;
				else cnt+=2;
			}
		}
	}
	lli l = n/m;

	cnt *= (l*l);
	lli cnt2 = 0;
	for(lli i = m*l+1; i <= n ; i++){
		for(lli j = 1 ; j<= m ; j++){
			if((i*i+j*j)%m == 0){
				cnt2+=2;
			}
		}
	}
	cnt2 *= l;
	cnt+=cnt2;
	for(lli i = m*l+1; i <= n ; i++){
		for(lli j = i ; j<= n ; j++){
			if((i*i+j*j)%m == 0){
				if(i==j) cnt++;
				else cnt+=2;
			}
		}
	}
	cout<<cnt;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)

char bel[4], els[4];

int main(){
    //freopen("in.in", "r", stdin);
    REP(i, 4) cin >> bel[i];
    REP(i, 4) cin >> els[i];

    int brow, erow;
    int b = 0, e = 0;

    // counting inversions
    // checking whether the blank is on odd row
    REP(i, 3){
        REP(j, 3){
            if(bel[i] == 'X')
              if(i < 2) brow = 1;
              else brow = 0;
            else if(i < j+1 && bel[i] > bel[j+1]) b++;
        }
    }

    REP(i, 3) {
        REP(j, 3){
            if(els[i] == 'X')
                if(i < 2) erow = 1;
                else erow = 0;
            else if(i < j+1 && els[i] > els[j+1]) e++;
        }
    }

    // checking solvability
    if((brow == 1) == (b % 2 == 0))
        b = 1;
    else b = 0;
    if((erow == 1) == (e % 2 == 0))
        e = 1;
    else e = 0;

    if (b == e) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[110],id[110];
int main(){
int n;scanf("%d",&n);
int s=0;
for(int i=1;i<=n;i++) scanf("%d",a+i),s+=a[i];
int ss=a[1],ans=0;
id[0]=1;
for(int i=2;i<=n;i++){
if(a[i]*2<=a[1]) {
id[++ans]=i;
ss+=a[i];
}
}
if(ss*2>s){
printf("%d\n",ans+1);
for(int i=0;i<=ans;i++) printf("%d ",id[i]);
}
else printf("0\n");
return 0;
}


/*
ID: zhaowei10
TASK:
LANG: C++14
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;

#ifdef LOCAL
#include <debug.h>
#else
#define debug(...) 0
#endif

#define eb emplace_back

using ll = long long;
using ld = long double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vc = vector<char>;
using vb = vector<bool>;
using vll = vector<ll>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(9);

#ifdef LOCAL
  freopen("test.in", "r", stdin);
  freopen("test.out", "w", stdout);
#else
#endif

  int w, h;
  cin >> w >> h;
  ll ans = 0;
  for (int i = 2; i <= w; i += 2) {
    for (int j = 2; j <= h; j += 2) {
      ll cur = (ll)(w - i + 1) * (h - j + 1);
      ans += cur;
    }
  }
  cout << ans;
}