/*
  Created by: Amit Kumar at 22:29 on 16 Mar 21
*/
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define db(...)
#endif
using namespace std;
#define ll long long
#define mod 1000000007
#define S(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)
#define all(x) x.begin(), x.end()
#define NIL -1
const int MAXN = 1e5 + 1;

long long power(long long x, long long y, long long md)
{
    long long res = 1;
    x = x % md;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % md;
        y = y >> 1;
        x = (x * x) % md;
    }
    return res;
}

void solve()
{
    int n;
    cin >> n;
    string t;
    cin >> t;
    string s;
    cin >> s;

    // true for Takahasi
    vector<vector<bool>> dp(n + 1, vector<bool>(7, 0));
    dp[n][0] = true;
    for (int i = n - 1; i >= 0; i--)
    {
        if (s[i] == 'A')
        {
            for (int j = 0; j < 7; j++)
            {
                dp[i][j] = dp[i + 1][(j * 10) % 7] && dp[i + 1][((j * 10) + t[i] - '0') % 7];
            }
        }
        else
        {
            for (int j = 0; j < 7; j++)
            {
                dp[i][j] = dp[i + 1][(j * 10) % 7] || dp[i + 1][((j * 10) + t[i] - '0') % 7];
            }
        }
    }
    db(dp);
    if (dp[0][0])
        cout << "Takahashi\n";
    else
        cout << "Aoki\n";
}
int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    auto started = std::chrono::high_resolution_clock::now();
#endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    t = 1;
    //cin >> t;
    for (int I = 1; I <= t; I++)
    {
#ifdef LOCAL
        cerr << "TestCase " << I << "\n";
#endif
        solve();
    }
#ifdef LOCAL
    auto done = std::chrono::high_resolution_clock::now();
    cerr << "Time = " << std::chrono::duration_cast<std::chrono::milliseconds>(done - started).count() << " ms\n";
#endif
    return 0;
}

/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define ALL(a) a.begin(), a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define TRAV(x, a) for (auto &x : a)

using namespace std;
using ll = long long; using ld = double;
using pi = pair<int, int>; using pl = pair<ll, ll>; using pd = pair<ld, ld>;
using cd = complex<ld>; using vcd = vector<cd>;

using vi = vector<int>; using vl = vector<ll>;
using vd = vector<ld>; using vs = vector<string>;
using vpi = vector<pi>; using vpl = vector<pl>; using vpd = vector<pd>; // vector<pair>

template<class T> using min_pq = priority_queue<T, vector<T>, greater<T> >;
template<class T> inline int ckmin(T& a, const T& val) { return val < a ? a = val, 1 : 0; }
template<class T> inline int ckmax(T& a, const T& val) { return a < val ? a = val, 1 : 0; }
template<class T> void remDup(vector<T>& v) { sort(ALL(v)); v.erase(unique(ALL(v)), end(v)); }

constexpr int pct(int x) { return __builtin_popcount(x); } // # of bits set
constexpr int bits(int x) { return x == 0 ? 0 : 31-__builtin_clz(x); } // floor(log2(x))
constexpr int p2(int x) { return 1<<x; }
constexpr int msk2(int x) { return p2(x)-1; }

ll ceilDiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); } // divide a by b rounded up
ll floorDiv(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); } // divide a by b rounded down
void setPrec(int x) { cout << fixed << setprecision(x); }

// TO_STRING
#define ts to_string
string ts(char c) { return string(1, c); }
string ts(const char* s) { return (string) s; }
string ts(string s) { return s; }
string ts(bool b) { return ts((int)b); }
template<class T> string ts(complex<T> c) { stringstream ss; ss << c; return ss.str(); }
template<class T> using V = vector<T>;
string ts(V<bool> v) {string res = "{"; FOR(i,0,SZ(v)-1) res += char('0'+v[i]); res += "}"; return res; }
template<size_t sz> string ts(bitset<sz> b) { string res = ""; FOR(i,0,SZ(b)-1) res += char('0'+b[i]); return res; }
template<class T, class U> string ts(pair<T,U> p);
template<class T> string ts(T v) { // containers with begin(), end()
    bool fst = 1; string res = "";
    for (const auto& x: v) { if (!fst) res += " "; fst = 0; res += ts(x); }
    return res;
}
template<class T, class U> string ts(pair<T,U> p) { return "("+ts(p.FI)+", "+ts(p.SE)+")"; }

// OUTPUT
template<class T> void pr(T x) { cout << ts(x); }
template<class T, class ...U> void pr(const T& t, const U&... u) { pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
template<class T, class ...U> void ps(const T& t, const U&... u) { pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
template<class T, class ...U> void DBG(const T& t, const U&... u) { cerr << ts(t); if (sizeof...(u)) cerr << ", "; DBG(u...); }
#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
        << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);

const ld PI = acos(-1.0);
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
const ld EPS = 1e-9;
const ll MODBASE = 1000000007LL;
const int INF = 0x3f3f3f3f;

const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    cin >> n;
    int l = 1, r = 1000;
    FOR(i,1,n) {
        int u;
        cin >> u;
        ckmax(l, u);
    }
    FOR(i,1,n) {
        int u;
        cin >> u;
        ckmin(r, u);
    }
    // dbg(l, r);
    if (l > r) cout << 0;
    else cout << r-l+1;
    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
#include <limits>
#include <numeric>
#include <type_traits>
#include <bitset>

using namespace std;

#define rep(i,n,m) for(ll (i)=(n);(i)<(m);(i)++)
#define rrep(i,n,m) for(ll (i)=(n);(i)>(m);(i)--)
using ll = long long;
const ll mod = 998244353;

void bitadd(ll a,ll w, vector<ll>& bit){

    a += 1;
    ll x = a;
    if (a == 0){
        exit(1);
    }
    while (x <= (bit.size()-1)){
        bit[x] = (bit[x] + w) % mod;
        x += (x & (-x));
    }

    return;
}

ll bitsum(ll a,vector<ll>& bit){

    a += 1;
    ll ret = 0;
    ll x = a;
    if (a == 0){
        exit(1);
    }
    while (x > 0){
        ret = (ret + bit[x]) % mod;
        x -= (x & (-x));
    }

    return ret;
}

int main(){

    ll N,K;
    cin >> N >> K;

    vector<vector<ll>> dp(N-K+5,vector<ll> (2*(N-K+5)));
    bitadd(min(2*(N-K+3),K), 1 ,dp[0]);

    rep(i,1,N-K+1){

        rep(j,0,i){
            ll now = ((bitsum(2*(N-K+3),dp[j]) - bitsum((i-j-1),dp[j])) + mod) % mod;
            bitadd(min((i-j)*2,2*(N-K+3)) , now , dp[i]);
        }
    }

    cout << (bitsum(2*(N-K+3),dp[N-K]) % mod) << endl;

}


#include <iostream>
#include <utility>
#include <algorithm>
#include <unordered_map>
using namespace std;

int main(void)
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  unordered_map<int, pair<int, int>> dp;
  int N, K;
  cin >> N >> K;
  while (K > 0)
  {
    if (dp.find(N) != dp.end())
      N = dp[N].first - dp[N].second;
   	else
    {
      string &&tmp = to_string(N);
      sort(tmp.begin(), tmp.end());
      int &&small = stoi(tmp);
      reverse(tmp.begin(), tmp.end());
      int &&big = stoi(tmp);
      dp[N] = pair<int, int>(big, small);
      N = big - small;
      if (N == 0)
        break;
    }
    K--;
  }
  cout << N << '\n';
  return 0;
}

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <functional>
#include <cassert>
#include <stack>
#include <numeric>
#include <iomanip>
#include <limits>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <chrono>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<ll, ll> Pll;
typedef std::pair<double, double> Pdd;

#define rip(_i, _n, _s) for (int _i = (_s); _i < (int)(_n); _i++)
#define all(_l) _l.begin(), _l.end()
#define rall(_l) _l.rbegin(), _l.rend()
#define MM << " " <<

template<typename _T>
using MaxHeap = std::priority_queue<_T>;
template<typename _T>
using MinHeap = std::priority_queue<_T, std::vector<_T>, std::greater<_T>>;

template<typename _T>
inline bool chmax(_T &_l, const _T _b) {
    if (_l < _b) {
        _l = _b;
        return true;
    }
    return false;
}
template<typename _T>
inline bool chmin(_T &_l, const _T _b) {
    if (_l > _b) {
        _l = _b;
        return true;
    }
    return false;
}

template<typename _T>
void vdeb(const std::vector<_T> &bb) {
    for (unsigned int i = 0;i < bb.size();i++) {
        if (i == bb.size() - 1) std::cout << bb[i];
        else std::cout << bb[i] << ' ';
    }
    std::cout << '\n';
}
template<typename _T>
void vdeb(const std::vector<std::vector<_T>> &bb) {
    for (unsigned int i = 0;i < bb.size();i++) {
        // std::cout << i << ' ';
        vdeb(bb[i]);
    }
    std::cout << '\n';
}

using namespace std;

int main() {
    int n; cin >> n;
    vector<Pii> s(n), t(n);
    rip(i,n,0) {
        cin >> s[i].first >> s[i].second;
    }
    rip(i,n,0) {
        cin >> t[i].first >> t[i].second;
    }
    if(n == 1) {
        cout << "Yes" << endl;
        return 0;
    }
    auto dist = [&](Pii &x, Pii &y) -> int {
        return (x.first-y.first)*(x.first-y.first) + (x.second-y.second)*(x.second-y.second);
    };
    auto area = [&](Pii x, Pii y) -> int {
        return x.first*y.second-x.second*y.first;
    };
    auto minu = [](Pii x, Pii y) {
        return make_pair(x.first-y.first, x.second-y.second);
    };
    auto dataset = [&](vector<Pii> &da, int a, int b) -> vector<Pii> {
        vector<Pii> ret;
        Pii x = minu(da[a], da[b]);
        ret.reserve(n-2);
        rip(i,n,0) {
            if(i == a || i ==b) continue;
            ret.push_back({dist(da[i], da[b]), area(x, minu(da[i], da[b]))});
        }
        sort(all(ret));
        return ret;
    };
    auto base = dataset(s, 0, 1);
    // vdeb(base);
    rip(i,n,0) rip(j,n,0) {
        if(i == j || dist(s[0], s[1]) != dist(t[i], t[j])) continue;
        auto tmp = dataset(t, i, j);
        // vdeb(tmp);
        if(base == tmp) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pvllvll pair <vector <ll>, vector <ll> >
#define ld long double
#define veci vector <int>
#define vecll vector <ll>

const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const double PI = 3.1415926535897932384626433832795;
const double eps = 1e-9;
const int MOD1 = 1e9 + 7;
const int MOD2 = 998244353;

void solve() {
    int n;
    cin >> n;
    vector <pii> a(n);
    for(auto &it : a) cin >> it.f >> it.s;
    for(int i = 0; i < n; ++i) {
        for(int j = i + 1; j < n; ++j) {
            for(int k = j + 1; k < n; ++k) {
                if((a[i].f - a[j].f) * (a[k].s - a[j].s) == (a[k].f - a[j].f) * (a[i].s - a[j].s)) {
                    cout << "Yes";
                    return;
                }
            }
        }
    }
    cout << "No";
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    ///cin >> T;
    while(T--) solve(), cout << '\n';
    return 0;
}

#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define ll long long
#define min3(a,b,c) min(min((a),(b)),(c))
#define min4(a,b,c,d) min(min((a),(b)),min((c),(d)))
#define max3(a,b,c) max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define S second
#define F first
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define PI 3.14159265358979323846;
#define MOD 1000000007
using namespace std;

int main()
{
    FAST;

    int n;
    cin >> n;

    vector <ll> v(n);

    ll s_a = 0;

    for(int i = 0; i < n; i++)
    {
        ll a, b;
        cin >> a >> b;

        s_a -= a;

        v[i] = 2 * a + b;
    }

    sort(v.rbegin(), v.rend());

    int c = 0;

    for(int i = 0; i < n; i++)
    {
        if(s_a > 0)
        {
            break;
        }

        s_a += v[i];

        c += 1;
    }

    cout << c << "\n";

    return 0;
}


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

const int Mxn = 1e5;
int a[Mxn], n;

void solve() {
	ll N;
	cin >> N;
	for (ll i = 1; i <= 100000; ++i) {
		if ((i * i + i) >= 2 * N) {
			cout << i ;
			return;
		}
	}
}

int main() {
	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
}

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

#define int long long

#define test                int x;  cin>>x; while(x--)
#define fast                 ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define f(i,a,b)           for(int i = a; i < b; i++)
#define fe(i,a,b)          for(int i = a; i <= b; i++)

#define ALL(a)                      (a).begin(),(a).end()
#define RALL(a)                     (a).rbegin(), (a).rend()
#define SZ(a)                       int((a).size())

int32_t main(){
    int n;
    cin >> n;
    //cout << sqrt(n) << "\n";
    for(int i = 1,j = (int)sqrt(n); i <= (int)sqrt(n),j <= n; i++,j++){
        int sum = ((i*(i+1))/2);
        int sum1 = ((j*(j+1))/2);
        if(sum >= n){
            cout << i;
            break;
        }
        if(sum1 >= n){
            cout << j;
            break;
        }
    }
}


// KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(int i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(),a.end()
#define sz(x) (int)x.size()
#define szs(x) (int)x.length()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define eq equal_range
#define fs first
#define ss second
#define ins insert
#define mkp make_pair
#define endl "\n"
using namespace std;
typedef vector<ll> vll;
typedef vector<int> vin;
typedef vector<char> vch;
typedef vector<string> vst;
typedef set<ll> sll;
typedef set<int> sint;
typedef set<char> sch;
typedef set<string> sst;
typedef queue<ll> qll;
typedef queue<int> qin;
typedef deque<ll> dqll;
typedef deque<int> dqint;
typedef priority_queue<ll> pqll;
typedef priority_queue<int> pqin;
typedef map<ll,ll> mpll;
typedef map<int,int> mpin;
typedef pair<ll,ll> pll;
typedef pair<int,int> pin;
const ll MOD=1000000007;
const long double PI=3.1415926535897932384626433832795;
ll pwr(ll b,ll p){ll res=1;while(p){if(p&1) {res*=b; p--;}else{b*=b; p>>=1;}}return res;}
ll mpwr(ll b,ll p){ll res=1;while(p){if(p&1) {res=(res*b)%MOD; p--;}else{b=(b*b)%MOD; p>>=1;}}return res;}
int msb (int n) {return 31-__builtin_clz(n);}
ll msbl (ll n) {return 63-__builtin_clzll(n);}
int lsb (int n) {return __builtin_ctz(n);}
ll  lsbl (ll n) {return __builtin_ctzll(n);}
int setbit (int n) {return __builtin_popcount(n);}
ll setbitl (ll n) {return __builtin_popcountll(n);}
int main()
{
/*
freopen ("input.txt","r","stdin");
freopen ("output.txt","w","stdout");
*/
ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL);
ll n; cin>>n;
mpll mp;
F (i,0,n,1) {
	int a ; cin>>a;
	++mp[a%200];
}
ll cnt=0;
for (auto i : mp) {
	cnt+=((i.ss)*(i.ss-1))/2;
}
cout<<cnt;
return 0;
}
/* What we know is a drop , but what we don't know is an ocean !*/

#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>
#include <hash_map>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace __gnu_pbds;
using namespace std;

#define     lp(i,a,n)       for(ll i=a;i<n;i++)
#define     lp2(i,n,a)      for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            '\n'
#define     Endl            '\n'
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
#define     ordered_set     tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightX[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightY[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
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...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=1e5+1,oo=0x3f3f3f3f,MOD=1e9+7;
const long double PI = acos(-1),eps=1e-9;

void solve(){
    ll n,w;
    cin>>n>>w;
    cout<<n/w<<endl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    int t=1;
    //cin>>t;
    while(t--)
        solve();
    return 0;
}


#include <bits/stdc++.h>
#define all(n) (n).begin(), (n).end()
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define sqr(n) (n)*(n)
#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 IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef double db;

template<class T1, class T2> bool umin(T1& a, T2 b) { return a > b ? (a = b, true) : false; }
template<class T1, class T2> bool umax(T1& a, T2 b) { return a < b ? (a = b, true) : false; }
template<class T> void clear(T& a) { T().swap(a); }

const int N = 2e2 + 5, inf = 1 << 30;

int n, m, _, k;
int v[N];
bool f[N >> 1][N >> 1];

int main() {
    IOS; cin >> n;
    bool flag = 0;
    rep(i, 1, n) {
        int a, b; cin >> a >> b; --a, --b;
        if (a == -2 && b == -2) continue;
        if (a == -2) { if (v[b]) flag = 1; v[b] = -N; }
        else if (b == -2) { if (v[a]) flag = 1; v[a] = N; }
        else {
            if (b <= a) flag = 1;
            if (v[a] || v[b]) flag = 1;
            v[a] = b - a; v[b] = a - b;
        }
    }
    if (flag) { cout << "No"; return 0; }
    rep(i, 1, n)
        rep(j, 0, n - i) {
            if (!f[j][i + j]) rep(k, j + 1, i + j - 1) if (f[j][k] && f[k][j + i]) { f[j][i + j] = 1; break; }
            if (!f[j][i + j]) {
                f[j][i + j] = 1;
                rep(k, j << 1, (j << 1) + i - 1)
                    if (!(v[k] == i & v[k + i] == -i) && !(v[k] == N && !v[k + i]) && !(!v[k] && v[k + i] == -N) && !(!v[k] && !v[k + i])) {
                        f[j][i + j] = 0;
                        break;
                    }
        }
    }
    if (f[0][n]) cout << "Yes";
    else cout << "No";
    return 0;
}

/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;
mt19937 rng((uint64_t)chrono::steady_clock::now().time_since_epoch().count());

void solve() {
  int n;
  cin >> n;

  vector <int> l(n), r(n);
  map <int, set <int>> mp;
  for (int i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    mp[l[i]].insert(i);
    mp[r[i]].insert(i);
  }

  vector <int> dp(n + n + 1, 0);
  dp[0] = 1;
  for (int li = 1; li < n + n; li++) {
    for (int k = 1; li + k - 1 + k <= n + n; k++) {
    //out << " ====> { " << li << ", " << k << " } <====\n";
      if (dp[li - 1]) {
        if (dp[li + k - 1 + k])
          continue;
        dp[li + k - 1 + k] = 1;
        for (int i = li; i < li + k && dp[li + k - 1 + k]; i++) {
          set <int> s;
          for (int x : mp[i])
            s.insert(x);
          for (int x : mp[i + k])
            s.insert(x);
          dp[li + k - 1 + k] &= ((int)s.size() <= 1);
          for (int x : s) {
            if (l[x] != -1 && l[x] != i)
              dp[li + k - 1 + k] = 0;
            if (r[x] != -1 && r[x] != i + k)
              dp[li + k - 1 + k] = 0;
          }
        }
        //cout << "{ " << li << ", " << li + k - 1 + k << " } ==> " << dp[li + k - 1 + k] << "\n";
      }
    }
  }
  cout << (dp[n + n]? "Yes": "No") << "\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
}


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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a) memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int maxc = 400019;
vector <set <pii>> c(maxc);

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	int n; cin >> n;
	vi a(n), b(n); rep(i,n) cin >> a[i] >> b[i];
	int ans = 0;
	rep(i,n) c[a[i]].insert(mp(i,0));
	rep(i,n) c[b[i]].insert(mp(i,1));
	queue <int> que;
	rep(i,maxc){
		if(sz(c[i]) == 1) que.push(i);
	}
	while(!que.empty()){
		int f = que.front();
		que.pop();
		if(sz(c[f])){
			ans++;
			pii aa = *c[f].begin();
			c[f].erase(aa);
			aa.snd = 1 - aa.snd;
			int ff = (aa.snd == 0) ? a[aa.fst] : b[aa.fst];
			c[ff].erase(aa);
			if(sz(c[ff]) == 1) que.push(ff);
		}
	}
	rep(i,maxc){
		if(sz(c[i])) ans++;
	}
	cout << ans << endl;

	return 0;
}

#include<bits/stdc++.h>
#define pi 3.141592653589793238
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define MOD 1000000007
#define INF 999999999999999999
#define pb push_back
#define ff first
#define ss second

#define mt make_tuple
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const int N = 4e5 + 1;
ll parent[N], edges[N], sz[N];
ll findset(ll a){
    if(a == parent[a]){
        return a;
    }
    return parent[a] = findset(parent[a]);
}
void unionset(ll a, ll b){
    a = findset(a);
    b = findset(b);
    if(a == b){
        edges[a]++;
        return;
    }
    sz[a] += sz[b];
    parent[b] = a;
    edges[a] += edges[b] + 1;
}
int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll T = 1, i, j;

    //cin >> T;
    while (T--) {
        ll n;
        cin >> n;
        for(i = 1;  i < N; i++){
            parent[i] = i;
            sz[i] = 1;
        }
        for(i = 0; i < n; i++){
            ll a, b;
            cin >> a >> b;
            if(1){
                unionset(a ,b);
            }
        }
        ll ans = 0;
        set<ll> diffs;
        for(i = 1; i < N; i++){
            diffs.insert(findset(i));
        }
        for(auto i : diffs){
            ans += min(edges[i], sz[i]);
        }
        cout << ans << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')';}
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) {os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
template<typename T> void dbg_a(const T *a,int l,int r){cerr<<" {";for(int i = l;i<r;i++) cerr<<a[i]<<", ";cerr<<a[r]<<"}"<<endl;}
typedef long long ll;
#define int ll
inline int read(){
    int f(1),r(0);char c(getchar());
    while(c<'0'||c>'9'){if(c == '-') f = -1; c = getchar();}
    while(c>='0'&&c<='9'){ r = (r<<1) + (r<<3) + c - '0';c = getchar();}
    return f*r;
}
void read(int &x){ x = read();}
template<class Head, class... Tail> void read(Head &head, Tail &... tail) { read(head); read(tail...); }
typedef pair<int,int> PII;
#define fi first
#define se second
#define mst(a,b) memset(a,b,sizeof(a))
#define For(i,a,b) for(int i = a;i<=b;i++)
#define For_(i,a,b) for(int i = a;i>=b;i--)
#define _for(i,a) for(int i = 0;i<a;i++)
#define Sum(a,l,r) accumulate(a + l,a + r + 1,0)
#define All(x) x.begin(),x.end()

//    For(i,1,n) For(j,1,m) printf("f[%lld][%lld] = %lld\n",i,j,f[i][j]);
const ll INF = 0x3f3f3f3f3f3f3f3f;
//const int INF = 0x3f3f3f3f;
const int N = 100 + 6,M = N*2 + 6;
const int mod = 1e9+7;
struct Mat{
    int val[105][105]; //自行设置大小
    int height,width;
    void clear(){
        memset(val,0,sizeof(val));
    }
    Mat() {}
    Mat(int height,int width) : height(height),width(width) { //用于初始化
        clear();
    }
    Mat operator *(const Mat &B){ // A * B
        Mat ret(this->height,B.width);
        for(int i = 1;i <= this->height;i++){
            for(int k = 1;k<=this->width;++k){
                if(this->val[i][k] == 0) continue;
                for(int j = 1;j<=B.width;j++){
                    ret.val[i][j] = (ret.val[i][j] + this->val[i][k]*B.val[k][j]%mod)%mod;//注意需不需要取模
                }
            }
        }
        return ret;
    }
    Mat pow(int n){
        Mat ret(this->height,this->width),base = (*this);
        for(int i = 1;i<=height;i++){
            ret.val[i][i] = 1;
        }
        while(n){
            if(n & 1) ret = ret * base;
            base = base * base;
            n >>= 1;
        }
        return ret;
    }
    void resize(int he,int wi){//不太好用
        this->width = wi;
        this->height = he;
    }
    static Mat I(int siz){//单位矩阵I
        Mat ret(siz,siz);
        for(int i = 1;i<=siz;i++){
            ret.val[i][i] = 1;
        }
        return ret;
    }
};
int mpow(int x,int k){
    int res = 1;
    while(k){
        if(k & 1) res = (ll)res * x % mod;
        x = (ll)x * x%mod;
        k >>=1;
    }
    return res;
}
int n,m,k;
PII edge[N*N];
int deg[N];
void solve(){
    read(n,m,k);
    Mat a(n,n),ans(1,n);
    For(i,1,n) ans.val[1][i] = read();
    For(i,1,m){
        int x = read(),y = read();
        edge[i] = {x,y};
        deg[x]++,deg[y]++;
    }
    int inv2m = mpow(2*m,mod-2);
    For(i,1,m){
        auto [x,y] = edge[i];
        a.val[x][y] = inv2m;
        a.val[y][x] = inv2m;
    }
    For(i,1,n){
        a.val[i][i] = (2*m - deg[i])*inv2m%mod;
    }
    a = a.pow(k);
    // For(i,1,n) {cout<<"\n";For(j,1,n) cout<<a.val[i][j]<<" ";}
    // cout<<"\n";
    ans = ans*a;
    For(i,1,n){
        cout<<ans.val[1][i]<<"\n";
    }
}
signed main(){
    int T = 1;
    //T = read();
    while(T--) solve();
    return 0;
}

// first second push_back unordered return continue break vector visited check flag bool while iterator begin end lower_bound upper_bound temp true false ll_MAX ll_MIN insert erase clear pop push compare ll64_MAX ll64_MIN  reverse replace stringstream string::npos length substr front priority_queue

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef std::vector<ll> vi;
typedef pair<ll, ll> pi;
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define boht_tez ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN ll(1e5 + 123)
#define MAXINP ll (1e3 + 123)
#define MAX_SIZE 100000000
#define    DOD(i)  cout<<setprecision(i)<<fixed<<
#define MOD 1000000007ll
#define pi 3.1415926536

int main()
{

#ifndef ONLINE_JUDGE
	// for getting input from input.tx
	freopen("input1.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output1.txt", "w", stdout);
#endif
	ll t = 1 ;
	//cin >> t;
	while (t--) {

		ll  x, y;
		cin >> x >> y;
		//cout << x << " " << y;
		if (x == 1 && y == 2 ) {
			cout << 0;
		}
		if (y == 1 && x == 2) {
			cout << 0;
		}
		if (x == 1 && y == 0) {
			cout << 2;
		}
		if (y == 1 && x == 0) {
			cout << 2;
		}
		if ( x == 0 && y == 2 ) {
			cout << 1;
		}
		if (y == 0 && x == 2) {
			cout << 1;
		}
		if (x == y) {
			cout << x;
		}

	}
}


    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=1e9+7;

    void solve(){
      ll t,n;
      cin>>t>>n;
      int p=100+t;
      set<ll>st;
      rep(i,100){st.insert(p*i/100);}
      vector<ll>b;
      rep(i,p*100/100){
        if(!st.count(i)){
          b.push_back(i);
        }
      }
      ll x=(n-1)/t,y=(n-1)%t;
      ll ans=p*x+b[y];
      cout<<ans<<endl;
    }
    int main(){
      solve();
      return 0;
    }

#pragma GCC optimize("Ofast")
#if 1
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using ll = int64_t;
using db = double;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define show(x) cerr << #x << " = " << (x) << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo(x) cout<<((x)?"Yes":"No")<<newl;
#define YESNO(x) cout<<((x)?"YES":"NO")<<newl;
#define v(T) vector<T>
#define vv(T) vector<vector<T>>

template<class A, class B> using umap = unordered_map<A, B>;
template<class A> using uset = unordered_set<A>;

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const pair<T, T>& v) {
  o << "(" << v.first << "," << v.second << ")";
  return o;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T> ostream& operator<<(ostream& o, const set<T>& v) {
  for (auto e : v) {
    o << e << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N; cin >> N;
  int day = 1;
  while ((1 + day) * day / 2 < N) day++;
  cout << day;
}
#endif


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

#define int int64_t

const int MOD = 998244353;
const int N = 5005;

int P[N][N];

int power(int x, int y) {
    if (P[x][y] != -1) return P[x][y];
    if (y < 0) return 0;
    int u = x;
    int v = y;
    int res = 1;
    while (y) {
        if (y % 2) res = res * x % MOD;
        y >>= 1;
        x = x * x % MOD;
    }
    return P[u][v] = res;
}

int32_t main() {
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) P[i][j] = -1;
    }
    int64_t res = 0;
    for (int h = 1; h <= m; h++) {
        for (int l = 1; l <= n; l++) {
            if (l == n) {
                res += (power(m - h + 1, l) - power(m - h, l) + MOD) % MOD;
                res %= MOD;
            } else {
                res += (n - l - 1) * (power(m - h + 1, l) - power(m - h, l) + MOD) % MOD * power(h - 1, 2) % MOD * power(m, n - l - 2) % MOD;
                res %= MOD;
                res += 2 * (power(m - h + 1, l) - power(m - h, l) + MOD) % MOD * (h - 1) % MOD * power(m, n - l - 1) % MOD;
                res %= MOD;
            }
        }
    }
    cout << res << '\n';
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

char s[2000][2001];
int a[2000][2000];
int b[2000][2000];

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

    int h, w;
    cin >> h >> w;

    for (int i = 0; i < h; i++) {
        cin >> s[i];
    }

    for (int i = 0; i < h; i++) {
        int k = 0;
        for (int j = 0; j <= w; j++) {
            if (j == w || s[i][j] == '#') {
                for (int l = j - k; l < j; l++) {
                    a[i][l] = k;
                }
                k = 0;
            } else {
                k++;
            }
        }
    }
    for (int j = 0; j < w; j++) {
        int k = 0;
        for (int i = 0; i <= h; i++) {
            if (i == h || s[i][j] == '#') {
                for (int l = i - k; l < i; l++) {
                    b[l][j] = k;
                }
                k = 0;
            } else {
                k++;
            }
        }
    }

    vector<int> x(h * w + 1);
    x[0] = 1;
    for (int i = 1; i <= h * w; i++) {
        x[i] = x[i - 1] * 2 % P;
    }

    ll r = 0;
    int l = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (s[i][j] == '#') continue;

            l++;
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (s[i][j] == '#') continue;

            int k = a[i][j] + b[i][j] - 1;
            r += (ll)x[l - k] * (x[k] - 1) % P;
        }
    }

    r %= P;
    if (r < 0) r += P;

    cout << r << endl;

    //マスの立場で考えると、この範囲に明かりが一つでもあるか

    return 0;
}


#include <bits/stdc++.h>
#include<sstream>
#include<string>
#include<vector>
#include <set>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define ff first
#define ss second
#define decimal(ans,w) cout<<fixed<<setprecision(w)<<ans
long long M=1000000007;
using namespace std;
ll fact[10000];
ll power(ll x, unsigned ll y, unsigned ll m)
{
    if (y == 0)
        return 1;
    ll p = power(x, y / 2, m) % m;
    p = (p * p) % m;

    return (y % 2 == 0) ? p : (x * p) % m;
}
unsigned long long modInverse(unsigned long long n,
                                            ll p)
{
    return power(n, p - 2, p);
}
unsigned long long nCrModPFermat(unsigned long long n,
                                 ll r, ll p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
    return (fact[n] * modInverse(fact[r], p) % p
            * modInverse(fact[n - r], p) % p)
           % p;
}
int32_t main()
{
  IOS
  string s;
  cin>>s;
  ll n=s.length(),x=0;
  deque<char>t;
  for(ll i=0;i<n;i++)
  {
      if(s[i]=='R')
      {
         x^=1;
      }
      else if(x)t.push_front(s[i]);
      else t.push_back(s[i]);
  }
  if(x)reverse(t.begin(),t.end());
  string s1;
  for(auto it:t)
  {
      if(s1.length()>0 && s1.back()==it)
      {
          s1.pop_back();
      }
      else s1.push_back(it);
  }
  cout<<s1;
  return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;

int x[10];

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

    deque<char> d;

    int rev = 0; //1 is hanten
    int cnt = 0;

    rep(i,s.size()) {
        if (s[i] == 'R') rev = ~rev;
        else if (d.empty()) d.push_back(s[i]);
        else {
            if (rev) {
                if (s[i] != d.front()) {
                    d.push_front(s[i]);
                } else {
                    d.pop_front();
                }
            } else {
                if (s[i] != d.back()) {
                    d.push_back(s[i]);
                }else {
                    d.pop_back();
                }
            }
        }
    }
    string t = "";
    // cout << d.size() << endl;
    rep(i,d.size()) t += d[i];
    if (rev) reverse(t.begin(), t.end());
    cout << t << endl;
}


#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

__attribute__ ((constructor))
void fastio() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
}

int main(){
    int x, y;
    cin >> x >> y;
    if(min(x,y) + 3 > max(x,y)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define rep(a,n) for (int a = 0; a < (n); ++a)
using namespace std;
using ll = long long;

ll t,n;

ll f(ll A){
	return (100+t)*A/100;
}

bool check(ll x){
	if(f(x)-x<=n)return true;
	else return false;
}

ll BinarySearch(){
	ll ok = 0;
	ll ng = 1e16;
	while(abs(ok-ng)>1){
		ll mid = (ok+ng)/2;
		if(check(mid))ok=mid;
		else ng=mid;
	}
	return ok;
}

int main(){
	cin >> t >> n;
	n--;
	cout << f(BinarySearch()) + 1 << endl;
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;

using namespace std;

int main() {
  int N, D, H;
  cin >> N >> D >> H;
  double ans = 0.0;
  rep(i, N) {
    int d, h;
    cin >> d >> h;
    ans = max(ans, h - (H*1.0-h)/(D-d) * d);
  }
  cout << ans << endl;
  return 0;
}

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

int32_t main(){
    int n,d,h;cin>>n>>d>>h;
    vector<pair<int,int>>v;
    for(long long i=0;i<n;i++){
        int a,b;cin>>a>>b;
        v.push_back(make_pair(a,b));
    }
    int minval=INT_MAX;
    for(long long i=0;i<n;i++){
        minval=min(minval,atan((h-v[i].second)/(d-v[i].first)));
    }
    // minval=abs(minval * (180/3.14159));
    int ans=tan(minval)*d;
    // cout<<ans<<endl;
    int c=0.0;
    ans=max(c,h-ans);
    if(ans==0) cout<<"0.0";
    else  cout<<ans<<endl;
    return 0;
}


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

const int MOD = 1000000007;
vector<long long> fac, finv, inv;

void InitializeCombination(int COMMAX){
    fac.push_back(1LL);
    fac.push_back(1LL);
    finv.push_back(1LL);
    finv.push_back(1LL);
    inv.push_back(0LL); //Though 0^(-1) cannot be defined, there should be some number in inv[0]
    inv.push_back(1LL);
    for (int i = 2; i <= COMMAX; i++){
        fac.push_back(fac[i-1] * (long long)i % (long long)MOD);
        inv.push_back((long long)MOD - inv[MOD%i] * (long long)(MOD/i) % (long long)MOD);
        finv.push_back(finv[i-1] * inv[i] % (long long)MOD);
    }
}

long long Combination(int n, int r){
    if (n < r) return 0LL;
    if (n < 0 || r < 0) return 0LL;
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD;
}

long long InvCombination(int n, int r){
    if (n < r) return 0LL;
    if (n < 0 || r < 0) return 0LL;
    return finv[n] * (fac[r] * fac[n-r] % MOD) % MOD;
}

int HexCharToInt(char C){
    if((C>='0')&&(C<='9'))return C-'0';
    return C-'A'+10;
}

int main(void){
    string strN;
    int K;
    long long res = 0LL;
    cin >> strN >> K;
    vector<vector<long long>> numHex(1, vector<long long>(K+1, 0LL));
    int lenN = (int)strN.size();
    InitializeCombination(16);
    numHex.push_back({});
    for(int i=0; i<=K; i++)numHex[1].push_back(i == 1 ? 16LL : 0LL);
    for(int i=2; i<=lenN; i++){
        numHex.push_back({});
        for(int j=0; j<=K; j++){
            if((j==0)||(j>i)){
                numHex[i].push_back(0LL);
            }else{
                numHex[i].push_back((numHex[i-1][j]*j%MOD+numHex[i-1][j-1]*(17-j)%MOD)%MOD);
            }
        }
    }
    for(int i=1; i<lenN; i++){
        res += numHex[i][K]*15%MOD*inv[16]%MOD;
        res %= MOD;
    }
    set<int> setSpecies;
    int numSpecies = 0;
    for(int i=0; i<lenN; i++){
        int Ni = HexCharToInt(strN[i]);
        for(int j=0; j<Ni; j++){
            if((i==0)&&(j==0))continue;
            set<int> nxtSpecies = setSpecies;
            nxtSpecies.insert(j);
            int nxtNum = (int)nxtSpecies.size();
            if(nxtNum > K)continue;
            if(i<lenN-1){
                for(int k=K-nxtNum; k<=K; k++){
                    res += numHex[lenN-i-1][k]*Combination(nxtNum, nxtNum+k-K)%MOD*Combination(16-nxtNum, K-nxtNum)%MOD*InvCombination(16, k)%MOD;
                    res %= MOD;
                }
            }else{
                if(nxtNum==K){
                    res++;
                    res %= MOD;
                }
            }
        }
        setSpecies.insert(Ni);
        numSpecies = (int)setSpecies.size();
        if(numSpecies > K)break;
    }
    if(numSpecies == K)res = (res + 1) % MOD;
    cout << res << endl;
    return 0;
}


#include<bits/stdc++.h>
#define int long long
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define endl "\n"
using namespace std;

const int max_n = 1010;
const int max_k = 405;
const int Mod = 1e9+7;
const int inf = 2e18;

int n,m;
int a[max_n],b[max_n];
int dp[max_n][max_n];

int solve(int i,int j){
	if(i>=n) return (m-j);
	if(j>=m) return (n-i);
	if(dp[i][j]!=-1) return dp[i][j];

	int t1=inf,t2=inf,t3=inf,t4=inf;
	if(a[i]==b[j]){
		t1=solve(i+1,j+1);
	}
	t2=solve(i+1,j+1)+1;
	t3=solve(i+1,j)+1;
	t4=solve(i,j+1)+1;

	int ans = min(min(t1,t2),min(t3,t4));
	dp[i][j]=ans;
	return ans;
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	memset(dp,-1,sizeof(dp));
	cin>>n>>m;
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<m;i++) cin>>b[i];
	cout<<solve(0,0)<<endl;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using dijkstra = priority_queue<T, vector<T>, greater<T>>;

typedef long long ll;
typedef unsigned long long ull;
#define fbo find_by_order  // k th index
#define ook order_of_key   // strictly smaller than k
#define PI acos(-1.0)
#define inf 0x3f3f3f3f
#define lead_zero(x) __builtin_clzll(x)
#define trail_zero(x) __builtin_ctzll(x)
#define total_1s(x) __builtin_popcountll(x)
#define first_1(x) __builtin_ffsll(x)
#define log2_(x) __builtin_clz(1) - __builtin_clz(x)
#define isLeap(x) ((x % 400 == 0) || (x % 100 ? x % 4 == 0 : false))
#define QUERY           \
    int test;           \
    scanf("%d", &test); \
    for (int _T = 1; _T <= test; _T++)
#define FAST ios_base::sync_with_stdio(0), cin.tie(0)
#define all(v) v.begin(), v.end()
#define reunique(v) v.resize(std::unique(all(v)) - v.begin())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define ff first
#define ss second
#define MERGE(v1, v2, v) merge(all(v1), all(v2), back_inserter(v))
#define MP make_pair
#define EB emplace_back
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define in_range(v, r, l) upper_bound(all(v), r) - lower_bound(all(v), l)
#define LCM(a, b) (a / __gcd(a, b)) * b;

ll rdn(int y, int m, int d) {
    /* Rata Die day one is 0001-01-01 */
    if (m < 3)
        y--, m += 12;
    return 365 * y + y / 4 - y / 100 + y / 400 + (153 * m - 457) / 5 + d - 306;
}
mt19937 R(chrono::system_clock().now().time_since_epoch().count());

int A[1009], B[1009];
int dp[1009][1009];
int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> A[i];
    }
    for (int i = 1; i <= m; i++) {
        cin >> B[i];
    }

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            if (!i || !j) {
                dp[i][j] = i + j;
            } else {
                dp[i][j] = dp[i - 1][j] + 1;
                dp[i][j] = min(dp[i][j], dp[i][j - 1] + 1);
                dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] + (A[i] == B[j] ? 0 : 1));
            }
        }
    }
    cout << dp[n][m] << "\n";
}


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

typedef long double ld;
const long long inf = 1100000000000000000;
#define maxn 1000005
#define mod 1000000007 //998244353
#define int long long
#define PB push_back
#define F first
#define S second
#define vi vector<int>
#define rep(i,a,b)  for( int i = a; i < b; i++ )
#define rep1(i,a,b) for( int i = a; i <= b; i++)
#define repd(i,a,b) for( int i = a; i >= b; --i)
#define sz(x) (int)((x).size())
#define all(c) (c).begin(),(c).end()
#define allr(v) v.rbegin(),v.rend()
#define mem(a,x) memset(a,x,sizeof(a))
#define dbg(a) cout << #a << " is " << (a); cout << "\n";

//...
int a, b, c;
bool ck(){
	return a*a + b*b < c*c;
}
void solve(){
	cin>>a>>b>>c;
	if(ck())
		cout<<"Yes";
	else
		cout<<"No";
}

signed main(){
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
	int T=1; //cin>>T;
    while(T--){
        solve(); cout<<'\n';
    }
    return 0;
}

/*input
10 3

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long int ll;
#define ld double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(double i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
const ll maxn=3e5+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define MP make_pair
ll mult(ll a,ll b){
    ll res=0LL;
    while(b){
        if(b&1) res=(res+a)%MOD;
        a=(a+a)%MOD;
        b>>=1;
    }
    return res%MOD;
}
ll mypow(ll a,ll b){
    ll res=1LL;
    while(b){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int a,b;
    cin>>a>>b;
    cout<<(a/b);
}


/* Author VS_CODE */

#include<bits/stdc++.h>
#define fr first
#define sc second
#define pb emplace_back

using namespace std;

void online()
{
#ifndef ONLINE_JUDGE
	freopen("input","r",stdin);
	freopen("output","w",stdout);
#endif
}

/* CODE STARTS HERE */

const int N = 2e5+7;

int ans=0;

void solve()
{
	int n;
	cin>>n;
	int A[n],B[n];
	for(int i=0;i<n;i++)
		cin>>A[i];
	for(int i=0;i<n;i++)
		cin>>B[i];
	int b=1e9+7;
	int a=0;
	for(auto i:A)
		a=max(i,a);
	for(auto i:B)
		b=min(i,b);
	cout<<max(0,b-a+1);

}

/* CODE ENDS HERE AND MAIN STARTS */

int main()
{
//	online();
	// int t;cin>>t;while(t--)
	solve();
}

/*
    I love the sound you make when you shut up.
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
/*-------typedefs------*/
template<class T> using ordered_set = tree<T, null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update> ;
using ll = long long;
using pi = pair<int, int>;
/*-----in and out--------*/
#define pf(a) cout << a << endl
#define forIn(arr, num) for(int i = 0; i < num; i++) cin >> arr[i];
#define vpnt(ans) for(int i = 0; i < int(ans.size()); i++) cout << ans[i] << (i + 1 < int(ans.size()) ? ' ' : '\n');
/*---useful defines------*/
#define sz(x) (int)(x).size()
#define pb push_back
#define mem(a, b) memset(a,(b), sizeof(a))
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
/*----- the binary answer of life-----*/
#define no cout << "NO" << endl
#define yes cout << "YES" << endl
/*---checking and pushing-----*/
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
/*---- FAST I/O and file read ---*/
void go() {
    ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
}
/*-------- test-case stuff--------------*/
#define ssolve solve();
#define msolve int T;cin >> T;while(T--) {solve();}
#define mcsolve int T;cin >> T;for(int tt = 1;tt <= T;tt++) {cout << "Case #" << tt << ": ";solve();}
/*-------- movement in a 2D array ------*/
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 MOD = 1e9 + 7;
const int N = 2e5 + 5;
/*-------------- Push your limits here ---------------------------*/
void solve() {
    int n;
    cin >> n;

    vector<int> a(n);
    forIn(a, n);
    vector<int> b(n);
    forIn(b, n);

    int cnt = 0;
    for(int i = 1;i <= 1000;i++) {
        bool flag = true;
        for(int j = 0;j < n;j++) {
            if(i < a[j] || i > b[j]) {
                flag = false;
                break;
            }
        }

        if(flag) cnt++;
    }

    pf(cnt);
}

int main() {
    go();
    ssolve
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M), B(M);
  rep(i, M) { cin >> A[i] >> B[i]; }
  int K;
  cin >> K;
  vector<int> C(K), D(K);
  rep(i, K) { cin >> C[i] >> D[i]; }
  int res = 0;
  for (int mask = 0; mask < (1 << K); mask++) {
    vector<bool> dishes(N + 1);
    rep(i, K) {
      if (mask & (1 << i)) {
        dishes[C[i]] = true;
      } else {
        dishes[D[i]] = true;
      }
    }
    int cnt = 0;
    rep(i, M) {
      if (dishes[A[i]] && dishes[B[i]]) {
        cnt++;
      }
    }
    res = max(res, cnt);
  }
  cout << res << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define endl '\n'
#define all(x) (x).begin(),(x).end()
const int INF=1000000000+5;
const int N=1e5+5;
const ll oo=1e18+5;
const ll mod=1e9+7;

map<int,pair<int,int>> get(int n,int L){
	vector<int> v{0};
	for(int i=1;i<=n+1;++i){
		int x=L+1;
		if(i<=n) cin>>x;
		v.push_back(x-i);
	}
	map<int,pair<int,int>> interval;
	for(int i=0;i<(int)v.size();++i){
		if(!i||v[i]!=v[i-1]){
			interval[v[i]].first=i;
		}
		interval[v[i]].second=i;
	}
	return interval;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	int n,L;
	cin>>n>>L;
	auto a=get(n,L);
	auto b=get(n,L);
	//~ cout<<"a : "<<endl;
	//~ for(auto x:a){
		//~ cout<<"("<<x.first<<")["<<x.second.first<<","<<x.second.second<<"]"<<endl;
	//~ }
	//~ cout<<"b : "<<endl;
	//~ for(auto x:b){
		//~ cout<<"("<<x.first<<")["<<x.second.first<<","<<x.second.second<<"]"<<endl;
	//~ }
	ll ans=0;
	for(auto x:b){
		int val=x.first;
		if(!a.count(val)){
			return cout<<-1,0;
		}
		ans+=max(0,a[val].first	-b[val].first)+max(0,b[val].second-a[val].second);
	}
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
#define I return
#define LOVE 0
#define TIANYUAN ;
using namespace std;

const int N=1000007;

int n,q;
char s[N];
int a[N],b[N];
int t;
bool flag=false;

int main()
{
	cin>>n;
	scanf("%s",s);
	for(int i=1;i<=n;i++)
	{
		a[i]=i;
		b[i]=n+i;
	}
	cin>>q;
	for(int i=1;i<=q;i++)
	{
		cin>>t;
		int x,y;
		if(t==1)
		{
			cin>>x>>y;
			if(!flag)
			{
				if(x>n)
				{
					if(y>n)
						swap(b[x-n],b[y-n]);
					else
						swap(b[x],a[y]);
				}
				else
				{
					if(y>n)
						swap(a[x],b[y-n]);
					else
						swap(a[x],a[y]);
				}
			}
			else
			{
				if(x>n)
				{
					if(y>n)
						swap(a[x-n],a[y-n]);
					else
						swap(a[x],b[y]);
				}
				else
					{
						if(y>n)
							swap(b[x],a[y-n]);
						else
							swap(b[x],b[y]);
					}
			}
		}
		if(t==2)
		{
			cin>>x>>y;
			if(flag==true)
				flag=false;
			else
				flag=true;
		}
	}
	if(!flag)
	{
		for(int i=1;i<=n;i++)
			cout<<s[a[i]-1];
		for(int i=1;i<=n;i++)
			cout<<s[b[i]-1];
	}
	else
	{
		for(int i=1;i<=n;i++)
			cout<<s[b[i]-1];
		for(int i=1;i<=n;i++)
			cout<<s[a[i]-1];
	}
	I LOVE TIANYUAN
}

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define mp make_pair
#define pb push_back
#define pll pair<LL,LL>
#define pii pair<int,int>
#define y second
#define x first
#define LL long long
#define ULL unsigned long long
#define sqr(x) ((x)*(x))
#define pi acos(-1)
#define pdd pair<double,double>
#define MEM(x) memset(x,0,sizeof(x))
#define MEMS(x) memset(x,-1,sizeof(x))
using namespace std;
LL mod=1e9+7;
LL f_pow(LL a,LL b){
    LL res=1,temp=a;
    while(b){
        if(b&1)res=res*temp%mod;
        temp=temp*temp%mod;
        b>>=1;
    }
    return res;
}
void solve(){
    int n;
    scanf("%d",&n);
    char c[2][2];
    for(int i = 0;i<2;i++){
        for(int j =0;j<2;j++){
            scanf(" %c",&c[i][j]);
        }
    }
    if(n<=3){
        printf("1\n");
        return;
    }
    if(c[0][1]=='A'){
        if(c[0][0]=='A')printf("1\n");
        else{
            if(c[1][0]=='B'){
                printf("%d\n",f_pow(2,n-3));
            }
            else{
                int f[1005];
                f[0]=1;
                f[1]=1;
                for(int i=2;i<=n-2;i++){
                    f[i]=(f[i-1]+f[i-2])%mod;
                }
                printf("%lld\n",(f[n-3]+f[n-4])%mod);
            }
        }
    }
    else{
        if(c[1][1]=='B')printf("1\n");
        else{
            if(c[1][0]=='A'){
                printf("%d\n",f_pow(2,n-3));
            }
            else{
                int f[1005];
                f[0]=1;
                f[1]=1;
                for(int i=2;i<=n-2;i++){
                    f[i]=(f[i-1]+f[i-2])%mod;
                }
                printf("%lld\n",(f[n-3]+f[n-4])%mod);
            }
        }
    }
}

int main(){
    int t=1;
   // scanf("%d",&t);
    while(t--){
        solve();
    }
}


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

const int N = (2e5) + 5;
ll a[N];
ll ac[N];
ll ac2[N];
multiset<ll> ms;
multiset<ll> :: iterator it;
int n;

int main() {
  ios::sync_with_stdio(!cin.tie(0));
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ac[0] = a[0];
  for (int i = 1; i < n; ++i) {
    ac[i] = ac[i - 1] + a[i];
  }
  ac2[0] = ac[0];
  for (int i = 1; i < n; ++i) {
    ac2[i] = ac2[i - 1] + ac[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    ms.insert(-ac2[i]);
  }
  ll mx = 0;
  for (int i = 0; i < n; ++i) {
    ll x = -*ms.begin();
    mx = max(mx, ac[i] + x);
    if (i - 1 >= 0) {
      ms.erase(-ac2[i - 1]);
    }
  }
  cout << mx << "\n";
  return 0;
}

/*
   Problem name: -
   Difficulty level: -
   Techniques: -
   Hints: -
   Written by Thalyson
*/

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

#define vi vector< int >
#define vii vector< pair<int,int> >
#define vvi vector<vector< int > >
#define vvii vector<vector< pair<int,int> > >
#define int int64_t

#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define sortv(V) sort(all(V))
#define reversev(V) reverse(all(V))
#define uniquev(V) sortv(V),(V).erase(unique(all(V)),(V).end())
#define pb push_back

#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define debug(x) cout << #x << " is " << x << "\n";

// Trace dinâmico (parameter pack (c++11))
template<typename T>
void println(T a) { cout << a << "\n"; }
template<typename T, typename... Args>
void println(T a, Args... args) { cout << a << " "; println(args...); }

template<typename T>
void print(T a) { cout << a; }
template<typename T, typename... Args>
void print(T a, Args... args) { cout << a << " "; print(args...); }

template<typename T>
void printv(T a, string last="\n") {
    for(auto el: a)
      print(el, "");
    print(last);
}

template<typename T>
void scanv(T &a) {
    for(auto &el: a)
      cin >> el;
}

//Constants
#define EPS 1e-6
#define oo int(1LL<<60)
#define endl '\n'

//Directions ^>v<
const int dx4[4] = {-1, 0, 1, 0};
const int dy4[4] = {0, 1, 0, -1};

const int dx8[8] = {-1, -1, 0, 1, 1,  1,  0, -1};
const int dy8[8] = { 0,  1, 1, 1, 0, -1, -1, -1};

//Main
int N, M, K, CASES;

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

   cin >> N;

   int cur = 0;
   int ans = 0;
   int sum = 0;
   int great = 0;

   for(int i = 0; i < N; i++){
      int value;
      cin >> value;
      sum += value;
      great = max(great, sum);
      ans = max(ans, cur+great);
      cur += sum;
   }
   println(ans);

   /*
      Before submit:
         Check the corners cases
         Check solution restrictions

      For implementation solutions
         Check the flow of the variables
   */
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
#include <climits>
#include <functional>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<PII> VPI;
typedef vector<PLL> VPL;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<(n);i++)
#define rep2(i,n,m) for(ll i=n;i<(m);i++)
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
void YES(int a){
  if(a) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}
void Yes(int a){
  if(a) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

//#include <atcoder/all>

//using namespace atcoder;
//typedef modint998244353 mint;

int a_max=200200;
const ll mod=998244353;

VL fac(a_max),finv(a_max),inv(a_max);

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a){
  return modpow(a,mod-2);
}

void init(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  rep(i,a_max){
    if(i>1){
      fac[i]=fac[i-1]*i%mod;
      inv[i]=mod-inv[mod%i]*(mod/i)%mod;
      finv[i]=finv[i-1]*inv[i]%mod;
    }
  }
}

ll com(ll n,ll k){
  if(n<k) return 0;
  if(n<0||k<0) return 0;
  return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

int main(){
  ll N,M;
  cin>>N>>M;
  VVL X(15,VL(5050,-1));
  X[0][0]=1;
  init();
  rep1(i,15){
    ll T=(1ll<<(14-i));
    rep(j,5050){
      if(X[i-1][j]!=-1){
        rep(k,N+1){
          if(k%2) continue;
          if(j+T*k<=5000){
            if(X[i][j+T*k]==-1) X[i][j+T*k]=X[i-1][j]*com(N,k)%mod;
            else (X[i][j+T*k]+=X[i-1][j]*com(N,k)%mod)%=mod;
          }
        }
      }
    }
  }
  if(X[14][M]!=-1) cout<<X[14][M]<<endl;
  else cout<<0<<endl;

}

    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=998244353;

    struct mint {
      ll x;
      mint(ll x=0):x((x%mod+mod)%mod){}
      mint operator-() const { return mint(-x);}
      mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
      }
      mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
      }
      mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
      mint operator+(const mint a) const { return mint(*this) += a;}
      mint operator-(const mint a) const { return mint(*this) -= a;}
      mint operator*(const mint a) const { return mint(*this) *= a;}
      mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
      }

      mint inv() const { return pow(mod-2);}
      mint& operator/=(const mint a) { return *this *= a.inv();}
      mint operator/(const mint a) const { return mint(*this) /= a;}
     };
      istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
      ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
      struct combination {
      vector<mint> fact, ifact;
      combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
      }
      mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
      }
     } c(200005);

    void solve(){
      int n,m;
      cin>>n>>m;
      vector<mint>dp(m+1);
      dp[0]=1;
      for(int i=2;i<=m;i+=2){
        for(int j=0;j<=n;j+=2){
          if(i-j>=0){dp[i]+=dp[(i-j)/2]*c(n,j);}
        }
      }
      cout<<dp[m]<<endl;
    }
    int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      solve();
      return 0;
    }


#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <unordered_map>
#include <cstdlib>
#include <numeric>
#include <set>
using namespace std;

int main () {
	int N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A.at(i);
	}
	sort(A.begin(), A.end());
	string ans = "Yes";
	for (int i = 0; i < N; i++) {
		if (A.at(i) != i + 1) {
			ans = "No";
			break;
		}
	}
	cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(intt i=0;i<(intt)(n);i++)
#define repm(i,n) for(intt i=(intt)(n)-1;i>=0;i--)
#define rept(i,n) for(intt i=1;i<(intt)(n);i++)
#define reptm(i,n) for(intt i=(intt)(n);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define siz(s) (s).size()
#define fof(i,a,b) for(intt i=a;i<b;i++)
#define bitfor(bit,N) for (int bit = 0; bit < (1 << (intt)(N); ++bit)
#define eb emplace_back
using intt = int64_t;
using ldou = long double;
using vi=vector<int>;
using vt=vector<intt>;
using vc=vector<char>;
using vs=vector<string>;
using vd=vector<ldou>;
using vb=vector<bool>;
using vvi=vector<vi>;
using vvt=vector<vt>;
using vvc=vector<vc>;
using vvs=vector<string>;
using vvd=vector<vd>;
using pa=pair<intt,intt>;
using vpa=vector<pa>;
using mapt=map<intt,intt>;
using vmap=vector<mapt>;
using Graph = vector<vector<int>>; // グラフ型
intt gcd(intt a,intt b){if(a%b==0){return b;}else{return gcd(b,a%b);}}//最大公約数
intt lcm(intt a,intt b){return a*b/gcd(a,b);}//最小公倍数
intt sum(const long &a,const long &b){return(a+b)*(b-a+1)/2;}//合計
vector<long long>yakusu(long long N){vector<long long>res;for(long long i=1;i*i<=N;++i){if(N%i==0){res.push_back(i);if(N/i!=i)res.push_back(N/i);}}sort(res.begin(),res.end());return res;}//約数全部
intt sumi(intt n){int x=0;while(n>=10){x+=n%10;n/=10;}x+=n;return x;}//各桁の和
bool sque(long long N){long long r=(long long)floor(sqrt((long double)N));return(r*r)==N;}//平方数
intt max(intt a,intt b){if(a>b){return a;}else{return b;}}
intt min(intt a,intt b){if(a>b){return b;}else{return a;}}
#include <cmath>
bool integ(double x){return std::floor(x)==x;}
vector<intt> ruiseki(intt n,vector<intt> a){vector<intt>s(n+1,0);for(intt i=0;i<n;++i){s[i+1]=s[i]+a[i];}return s;}
void strsort(vector<string>&S){map<int,int>SwapInd;int maxi=0;for(int i=0;i<S.size();i++){if(S[i].size()>maxi)maxi=S[i].size();}for(int i=0;i<maxi;i++){int k=maxi-i;int sort_num=0;for(int j=0;j<S.size();j++){if(S[j].size()>=k){SwapInd[j]=1;sort_num++;}}int swapped=0;for(int j=0;j<S.size();j++){if(SwapInd[j]==1&&j<S.size()-sort_num){if(SwapInd[S.size()-sort_num+swapped]==0){iter_swap(S.begin()+j,S.begin()+S.size()-sort_num+swapped);}else{while(SwapInd[S.size()-sort_num+swapped]!=0){swapped++;if(S.size()-sort_num+swapped>=S.size()){break;}if(S.size()-sort_num+swapped<S.size()){iter_swap(S.begin()+j,S.begin()+S.size()-sort_num+swapped);}}}
     SwapInd[j]=0;SwapInd[S.size()-sort_num+swapped]=0;swapped++;}}vector<string>WhatSorted(sort_num);vector<pair<int,int>>char_and_index(sort_num);for(int j=0;j<sort_num;j++){if(S[S.size()-sort_num+j][k-1]>=65&&S[S.size()-sort_num+j][k-1]<=90){char_and_index[j].first=(int)S[S.size()-sort_num+j][k-1]+32;}else{char_and_index[j].first=(int)S[S.size()-sort_num+j][k-1];}char_and_index[j].second=j;WhatSorted[j]=S[S.size()-sort_num+j];}stable_sort(char_and_index.begin(),char_and_index.end());for(int j=0;j<sort_num;j++){S[S.size()-sort_num+j]=WhatSorted[char_and_index[j].second];}}}
intt fac(intt k){intt sum=1;for(intt i=1;i<=k;++i){sum*=i;}return sum;}
vector<bool> seen;
void dfs(const Graph &G,int v){seen[v]=true;for(auto next_v:G[v]){if(seen[next_v])continue;dfs(G,next_v);}}//DFS

intt mini=INT64_MAX;
intt maxi=INT64_MIN;
intt zero=0;
intt cnt=0;
intt su=0;
intt ans;
intt n;
string s;
Graph g;

int main() {
cout << fixed << setprecision(20);

cin>>n;
vi a(n);
rep(i,n){
     cin>>a[i];
}
sort(all(a));
rep(i,n){
     if(a[i]-1!=i){
          cout<<"No"<<endl;
          return 0;
     }
}
cout<<"Yes"<<endl;
}


#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)

#define MOD 1000000007

void abc(int x1, int y1, int x2, int y2, ll &a, ll &b, ll &c){
  a = y2 - y1;
  b = x1 - x2;
  c = (long long)x2 * y1 - (long long)x1 * y2;
}

double distpl(int x, int y, int a, int b, long long c){
  if(a == 0 && b == 0)return -1.0;
  long long n = llabs((long long)a * x + (long long)b * y + c);
  return (double)n / sqrt(a * a + b * b);
}

int main(){
  ll n;
  cin>>n;
  vector<pair<ll,ll> > vp;
  rep(i,0,n){
    ll a,b;
    cin>>a>>b;
    vp.pb(mp(a,b));
  }
  ll flag = 0;
  rep(i,0,vp.sz){
    rep(j,i+1,vp.sz){
      rep(k,j+1,vp.sz){
        ll a,b,c;
        abc(vp[i].fi,vp[i].se,vp[j].fi,vp[j].se,a,b,c);
        if(distpl(vp[k].fi,vp[k].se,a,b,c)==0.){
          flag = 1;
        }
      }
    }
  }
  if(flag==1){
      cout << "Yes" << endl;
  }
  else{
      cout << "No" << endl;
  }
  return 0;
}

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

int main(){
  int n;
  cin >> n;

  int ans = 0;
  vector<vector<int>> point(n, vector<int>(2));

  for (int i=0; i<n; i++){
    cin >> point[i][0] >> point[i][1];
  }
  for (int j=0; j<n; j++){
    for (int k=j+1; k<n; k++){
      for (int l=0; l<n; l++){
        if (l == j){
          continue;
        }
        else if (l == k){
          continue;
        }
        else if ((point[j][0] - point[k][0]) == 0){
          if (point[k][0] == point[l][0]){
            ans += 1;
          }
          else{
            continue;
          }
        }
        else{
          if ((point[j][1] - point[k][1])*(point[l][0]-point[j][0])%(point[j][0] - point[k][0]) == 0){
            int y;
            y =  (point[j][1] - point[k][1])*(point[l][0]-point[j][0])/(point[j][0] - point[k][0]) + point[j][1];
            if (y == point[l][1]){
              ans += 1;
          }

          }
        }
      }
    }
  }
  if (ans == 0){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" << endl;
  }
}


#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<int,int>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define INF 1e17

class Prime {
// n以下の素数を列挙する
public:
  const int n;
  vector<bool> is_prime;
  vector<int> primes;
  Prime(int size) : n(size), is_prime(n+1, true) {
    is_prime[0] = false;
    is_prime[1] = false;
    for (int i = 2; i <= n; ++i) {
      if (!is_prime[i]) continue;
      primes.push_back(i);
      int tmp = 2*i;
      while (tmp <= n) {
        is_prime[tmp] = false;
        tmp += i;
      }
    }
  }

  bool check(int x) { return is_prime[x]; }
};

int main(){
    ll n;
    cin>>n;
    ll x[n];
    rep(i,n){
        cin>>x[i];
    }
    vector<set<ll>> yakusu(n);
    vector<int> primes;
    rep(i,n){
        for(ll j=1;j*j<=x[i];j++){
            if(x[i]%j==0){
                if(j!=1)yakusu[i].insert(j);
                yakusu[i].insert(x[i]/j);
            }
        }
    }
    Prime prime(50);
  for (int p : prime.primes) {
    primes.push_back(p);
  }
  int num = primes.size();
  ll ans = INF;
  for(int i=1;i<1<<num;i++){
    ll koho = 1;
      for(int j=0;j<num;j++){
          if(i&1<<j)koho*=primes[j];
      }
      bool sodenai = true;
      for(int k=0;k<n;k++){
          bool check = false;
          for(auto di:yakusu[k]){
              if(koho%di==0)check=true;
          }
          if(!check)sodenai=false;
      }
      if(sodenai){
          if(ans==INF)ans=koho;
          if(ans>koho)ans=koho;
      }
  }
  cout<<ans<<endl;
}

#include<algorithm>
#include<cstdio>
#include<map>
typedef long long ll;
std::map<ll,ll>mp;
ll n,k;
ll now;
bool looped;
int zc[18],zcnt;
ll get(ll x,bool rev){
	zcnt=0;
	while(x){
		zc[++zcnt]=x%10;
		x/=10;
	}
	std::sort(zc+1,zc+zcnt+1);
	if(rev)std::reverse(zc+1,zc+zcnt+1);
	ll res=0;
	for(int i=zcnt;i;i--)res=(res<<3)+(res<<1)+zc[i];
	return res;
}
signed main(){
	mp.clear();
	scanf("%lld%lld",&n,&k);
	now=n;
	mp[now]=k;
	while(k){
//		printf("k=%lld\n",k);
		k--;
		now=get(now,false)-get(now,true);
//		puts("ok");
		if(mp[now]&&!looped){
			ll len=k-mp[now];
			k%=len;
			looped=true;
		}
		mp[now]=k;
	}
	printf("%lld",now);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
    if (a < b) a = b;
}

signed main() {
    int n, m;
    cin >> n >> m;
    int mx = 0;
    int w[n];
    rep(i, n) {
        cin >> w[i];
        chmax(mx, w[i]);
    }
    bool flag = false;
    pair<int, int> a[m];
    rep(i, m) {
        cin >> a[i].second >> a[i].first;
        if (a[i].first < mx) flag = true;
    }
    if (flag) {
        cout << -1 << endl;
        return 0;
    }
    sort(a, a + m);
    rep(i, m - 1) {
        chmax(a[i + 1].second, a[i].second);
    }
    int ans = INF;
    vector<int> v(n);
    iota(ALL(v), 0);
    do {
        int ww[n];
        rep(i, n) {
            ww[i] = w[v[i]];
        }
        vector<pair<int, int>> G[n];
        for (int cur = 0; cur < n; cur++) {
            int sum = ww[cur];
            for (int to = cur + 1; to < n; to++) {
                sum += ww[to];
                int idx = lower_bound(a, a + m, pair<int, int>(sum, 0)) - a;
                idx--;
                if (idx < 0)
                    G[cur].emplace_back(to, 0);
                else
                    G[cur].emplace_back(to, a[idx].second);
            }
        }
        int dp[n] = {};
        for (int v = 0; v < n; v++) {
            for (auto p : G[v]) {
                chmax(dp[p.first], dp[v] + p.second);
            }
        }
        ans = min(ans, dp[n - 1]);
    } while (next_permutation(ALL(v)));
    cout << ans << endl;
    return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0) {
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
int n,m,x[100002],y[1000002],p[100002];
int mp[1002][1002];
vector<int>g[100002];
struct node {
	int pos,c;
} s[102];
bool cmp(node x,node y){
	return x.c>y.c;
}bool vis[102];
inline void dfs(int pos){
	vis[pos]=1;
	F(i,0,g[pos].size()-1){if(s[g[pos][i]].c==s[pos].c)
		if(!vis[g[pos][i]]){
			mp[pos][g[pos][i]]=mp[g[pos][i]][pos]=pos;
			dfs(g[pos][i]);
		}else{
			if(!mp[pos][g[pos][i]])mp[pos][g[pos][i]]=mp[g[pos][i]][pos]=pos;
		}
	}
}
int main() {
	cin>>n>>m;
	F(i,1,m) {
		read(x[i]);
		read(y[i]);
		g[x[i]].push_back(y[i]);
		g[y[i]].push_back(x[i]);
	}
	F(i,1,n)s[i]=(node) {
		i,read()
	};
	F(i,1,n)if(!vis[i])dfs(i);
	F(i,1,n)
	{
		F(j,0,g[i].size()-1){
			if(s[g[i][j]].c<s[i].c){
				mp[i][g[i][j]]=mp[g[i][j]][i]=i;
			}
		}
	}F(i,1,m){
		if(mp[x[i]][y[i]]==x[i]){
			puts("->");
		}else{
			puts("<-");
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std ;
#define fast_io                ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define debug(x)               cerr << #x << " -> " << x << "\n"
#define here                   cerr << "here\n"
#define MP                     make_pair
#define F                      first
#define S                      second
typedef long long ll ;
typedef pair<int ,int> pii ;
constexpr int MAXN = 1e5 + 13 ;
constexpr int MOD = 1e2 + 10 ;
constexpr ll INF = 1e18 ;

struct Edge {
	int u ,v ;
};

int n ,m ,vis[MOD][MOD] ,c[MAXN] ,u ,v ,ans[MOD][MOD] ;
vector <int> G[MAXN] ;
Edge E[MAXN] ;

void dfs(int u){
	for (auto v : G[u]){
		if (c[v] == c[u] && !vis[u][v]){
			vis[u][v] = 1 ,vis[v][u] = 1 ;
			ans[u][v] = 1 ;
			dfs(v) ;
		}
	}
}

int main (){
	fast_io ;
	cin >> n >> m ;
	for (int i = 0 ;i < m ;i++){
		cin >> E[i].u >> E[i].v ;
		G[E[i].u].push_back(E[i].v) ;
		G[E[i].v].push_back(E[i].u) ;
	}
	for (int i = 1; i <= n; i++){
		cin >> c[i] ;
	}
	for (int i = 1; i <= n; i++){
		dfs(i) ;
	}
	for (int i = 0; i < m; i++){
		if (c[E[i].u] > c[E[i].v] || ans[E[i].u][E[i].v]){
			cout << "->\n" ;
		}
		else {
			cout << "<-\n" ;
		}
	}
	return 0 ;
}

/*
2 2 2 1 3
2 2 2 3 1

*/


#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>

#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int H, W;

pair<int, int> Next(int r, int c)
{
	if (c == W)
	{
		return { r + 1, 1 };
	}
	else
	{
		return { r, c + 1 };
	}
}

LLONG Count(
	int r, int c, int remA, int remB,
	set<pair<int, int>>& used)
{
	auto[nR, nC] = Next(r, c);

	// 使用済みは飛ばす
	if (used.count({ r, c }))
	{
		if (r == H && c == W)
		{
			return 1;
		}
		return Count(nR, nC, remA, remB, used);
	}

	// A を使い切ったら残りの敷き方は1通り
	if (remA == 0)
	{
		return 1;
	}

	// A を使い切れなかったら0通り
	if (r == H && c == W && remA != 0)
	{
		return 0;
	}

	LLONG ret = 0;
	if (remA > 0)
	{
		// 縦にAを敷く場合
		if (r < H && !used.count({ r + 1, c }))
		{
			used.insert({ r + 1, c });
			ret += Count(nR, nC, remA - 1, remB, used);
			used.erase({ r + 1, c });
		}
		// 横にAを敷く場合
		if (c < W && !used.count({ r, c + 1 }))
		{
			used.insert({ r, c + 1 });
			ret += Count(nR, nC, remA - 1, remB, used);
			used.erase({ r, c + 1 });
		}
	}
	if (remB > 0)
	{
		ret += Count(nR, nC, remA, remB - 1, used);
	}
	return ret;
}

int main()
{
	int A, B; cin >> H >> W >> A >> B;
	set<pair<int, int>> used;
	cout << Count(1, 1, A, B, used) << endl;
}

//#include <atcoder/maxflow.hpp>
#include <memory>
#include <iostream>
#include <map>
#include <list>
#include <set>
#include <algorithm>
#include <vector>
#include <sstream>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <limits>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <fstream>
#include <iterator>
#include <random>
#include <chrono>
#include <complex>

#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;

using namespace std;
//using namespace atcoder;

//ll modd = 1000 * 1000 * 1000 + 7;
ll modd = 998244353;

int main()   {

      ios_base::sync_with_stdio(false);

      cout.precision(17);
      mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no

//      auto start = chrono::steady_clock::now();

//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
       readll(a); readll(b); readll(c);
       ll ans = ((a*(a+1))/2) % modd;
       ans *= ((b*(b+1))/2) % modd; ans %= modd;
       ans *= ((c*(c+1))/2) % modd; ans %= modd;
       cout << ans << endl;
    }
    return 0;
}

//        auto stop = chrono::steady_clock::now();
//        auto duration = chrono::duration_cast<chrono::milliseconds>(stop - start);
//        cout << "Duration: " << duration.count() << endl;


#include<bits/stdc++.h>
using namespace std;
void solve()
{
  int a,b;
  cin>>a>>b;
  cout<<(2*a+100)-b;
}
int main()
{
    // int tc;
    // cin>>tc;
    // while(tc--)
    // {
    //     solve();
    // }
    solve();
}

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

#define int         long long
#define ull         unsigned long long
#define ll          long long
#define M           998244353
#define pb          push_back
#define p_q         priority_queue
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mp          make_pair
#define lb          lower_bound
#define ub          upper_bound
#define F           first
#define S           second
#define rep(i, begin, end) for (int i=begin;i<end;i++)
#define repd(i, begin, end) for (int i=end-1;i>=begin;i--)
#define ini(a,n,b)  for(ll int i=0;i<n;i++) a[i]=0;
#define cset(a)     __builtin_popcountll(a)
#define hell        1000000007
#define re          resize
const int INF=1e18;
const int N=300005;

int powm(int a,int b)
{
  int res=1;
  while(b)
  {
    if(b&1)
    res=(res*a)%M;
      a=(a*a)%M;
      b>>=1;
  }

  return res;
}

signed main(void)
{ios
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);freopen("answer.txt", "w", stdout);
    #endif

    int a,b;
    cin>>a>>b;
    cout<<2*a+100-b<<endl;

}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;
using LD = long double;

template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
void yes(bool ok = true){ cout << (ok ? "yes" : "no") << endl; }
void Yes(bool ok = true){ cout << (ok ? "Yes" : "No") << endl; }
void YES(bool ok = true){ cout << (ok ? "YES" : "NO") << endl; }

void Main(){
    int h, w; cin >> h >> w;
    vvi a(h, vi(w));
    int mn = 1e9;
    ll tot = 0;
    rep(i, h)rep(j, w){
        cin >> a[i][j];
        chmin(mn, a[i][j]);
        tot += a[i][j];
    }
    tot -= mn * h * w;
    cout << tot << endl;
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

#pragma GCC optimize("Ofast")
//#pragma GCC target ("sse4")
//https://atcoder.jp/contests/abc191/submissions/19973170
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acosl(-1.0);

ll mod_pow(ll x, ll n, ll m = mod) {
	if (n < 0) {
		ll res = mod_pow(x, -n, m);
		return mod_pow(res, m - 2, m);
	}
	if (abs(x) >= m)x %= m;
	if (x < 0)x += m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % m;
		x = x * x % m; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 2;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[a - b];
}

int gcd(int a, int b) {
	if (a < b)swap(a, b);
	while (b) {
		int r = a % b; a = b; b = r;
	}
	return a;
}
void solve() {
	int n; cin >> n;
	vector<int> a(n);
	rep(i, n)cin >> a[i];
	sort(all(a));
	vector<int> ds;
	rep(i, n) {
		for (int j = 1; j <= 32000; j++) {
			if (a[i] % j == 0) {
              if(j<=a[0])
				ds.push_back(j);
              if(a[i]/j<=a[0])
				ds.push_back(a[i] / j);
			}
		}
	}
  	unordered_set<int>us;
    for(auto & x:ds)us.insert(x);
  	ds.clear();
  	for(auto & x:us)ds.push_back(x);
	//sort(all(ds));
	//ds.erase(unique(all(ds)), ds.end());
	int ans = 0;
	for (int d : ds) {
		if (d > a[0])break;
		int g = 0;
		rep(j, n) {
			if (a[j] % d == 0)g = gcd(g, a[j]);
		}
		if (g == d)ans++;
	}
	cout << ans << "\n";
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	//init_f();
	//init();
	//expr();
	//int t; cin >> t; rep(i,t)
	//expr();
	solve();
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
using namespace std;
int t;
int l,r;
int main(){
	scanf("%d",&t);
	while(t--){
		scanf("%d %d",&l,&r);
		int ed=r-l;
		ll ans=0;
		if(ed>=l) ans+=(ll)(r-l*2+2)*(r-l*2+1)/2;
		else ans=0;
		printf("%lld\n",ans);
	}
	return 0;
}

//i:r-l-i+1
//3,

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define f(i,j,n) for(long long i = j ; i < n ; ++i)
#define ones(x) __builtin_popcount(x)
#define endl '\n'

using namespace std;
//using namespace __gnu_pbds;
typedef long long  ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef deque<int> di;
typedef deque<long long> dll;
typedef pair<long long, long long> pll;
typedef vector<pair<long long, long long>> vpll;
/*typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;*/
const ll N = 5e5 + 100;
const ll M = 1e5 + 100;
const ll inf = 1e9;

void solve(){
	ll l,r; cin >> l >> r;
	if(r < 2*l){
		cout << 0 << endl;
		return;
	}
	ll x = r -(2*l-1);
	cout << (x*(x+1))/2 << endl;
}

int main(){
	fastio;
	int t; cin >> t;
	while(t--) solve();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10;
int n, x[maxn], y[maxn], fa[maxn];
double l, r = 100, ans;
int find(int x) {
	if (x == fa[x]) return x; else return fa[x] = find(fa[x]);
}
void merge(int x, int y) {
	int kk = find(x), cc = find(y);
	if (kk != cc) fa[cc] = kk;
}
bool check(double r) {
	for (int i = 1; i <= n + 2; ++i) fa[i] = i;
	for (int i = 1; i <= n; ++i)
		for (int j = i + 1; j <= n; ++j)
		if (sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])) <= r * 2)
		merge(i, j);

	for (int i = 1; i <= n; ++i)
	if (abs(y[i] + 100) <= r * 2)
	merge(i, n + 1);

	for (int i = 1; i <= n; ++i)
	if (abs(y[i] - 100) <= r * 2)
	merge(i, n + 2);

	if (find(n + 1) != find(n + 2)) return 1; else return 0;
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) scanf("%d%d", &x[i], &y[i]);
	while (r - l >= (1e-5)) {
		double mid = (l + r) / 2;
		if (check(mid)) {
			ans = mid;
			l = mid;
		}
		else r = mid;
	}
	printf("%.4lf\n", ans);
	return 0;
}

//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <inttypes.h>
#include <map>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// #include <atcoder/dsu>
// using namespace atcoder;
// using mint = modint1000000007;
// using mint = modint998244353;
// using mint = modint;

using namespace std;

using ll = int64_t;
using ull = uint64_t;

[[maybe_unused]] constexpr ll LL_MAX = numeric_limits<ll>::max();
[[maybe_unused]] constexpr ll LL_MIN = numeric_limits<ll>::min();
[[maybe_unused]] constexpr ull ULL_MAX = numeric_limits<ull>::max();

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrep(i, a, b) for (ll i = (a)-1; i >= (b); i--)

template<typename T>
void chmin(T& x, T y) {
	x = min(x, y);
}

template<typename T>
void chmax(T& x, T y) {
	x = max(x, y);
}

ll csum(ll x, ll y) {
	if (x > 0 && y > 0 && x > LL_MAX - y) {
		return LL_MAX;
	}
	if (x < 0 && y < 0 && x < LL_MIN - y) {
		return LL_MIN;
	}
	return x + y;
}

ll readi() {
	ll ret;
	scanf("%" PRId64 "", &ret);
	return ret;
}

vector<ll> readvi(ll n) {
	vector<ll> ret(n);
	rep(i, 0, n) { ret[i] = readi(); }
	return ret;
}

double readf() {
	double ret;
	scanf("%lf", &ret);
	return ret;
}

string reads() {
	string s;
	cin >> s;
	return s;
}

void writei(ll x) {
	printf("%" PRId64 "\n", x);
}

void writevi(const vector<ll>& xs) {
    rep(i,0,xs.size()) {
        if (i < xs.size() - 1) {
            printf("%" PRId64 " ", xs[i]);
        } else {
            printf("%" PRId64 "\n", xs[i]);
        }
    }
}

void writes(const string& s) {
	cout << s.c_str() << endl;
}

void writef(double x) {
	printf("%.10f\n", x);
}

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
	return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
	auto inner = make_vec_nd(init, rest...);
	return vector<decltype(inner)>(size, inner);
}

struct UnionFind {
	vector<size_t> parent;
	vector<size_t> rank;
	size_t find_parent(size_t x) {
		if (parent[x] == x) {
			return x;
		} else {
			parent[x] = find_parent(parent[x]);
			return parent[x];
		}
	}
	explicit UnionFind(size_t size) {
		parent.resize(size);
		rank.resize(size);
		for (size_t i = 0; i < size; i++) {
			parent[i] = i;
			rank[i] = 0;
		}
	}
	virtual ~UnionFind() {}
	void unite(size_t x, size_t y) {
		size_t px = find_parent(x);
		size_t py = find_parent(y);
		if (px == py) {
			return;
		}
		if (rank[px] < rank[py]) {
			parent[px] = py;
		} else if (rank[px] > rank[py]) {
			parent[py] = px;
		} else {	// rank[px] == rank[py]
			parent[py] = px;
			rank[px]++;
		}
	}
	bool is_same(size_t x, size_t y) {
		return find_parent(x) == find_parent(y);
	}
	unordered_map<size_t, set<size_t>> create_map_parent_to_elements() {
		unordered_map<size_t, set<size_t>> ans;
		for (size_t i = 0; i < parent.size(); i++) {
			ans[find_parent(i)].insert(i);
		}
		return ans;
	}
};

struct P {
	double x;
	double y;
	double dist(const P& rhs) const {
		double sq = (x - rhs.x) * (x - rhs.x) + (y - rhs.y) * (y - rhs.y);
		return sqrt(sq);
	}
};

int main() {
	ll N = readi();
	vector<P> pts(N);
	rep(i,0,N) {
		pts[i].x = readi();
		pts[i].y = readi();
	}
	double good = 0.0;
	double bad = 100.0;
	while (bad - good > 1.0e-5) {
		double mid = (good + bad) / 2;
		UnionFind tree(N + 2);
		rep(i,0,N) {
			P a = pts[i];
			rep(j,i+1,N) {
				P b = pts[j];
				if (a.dist(b) < 2*mid) {
					tree.unite(i, j);
				}
			}
			if (a.y + 100 < 2*mid) {
				tree.unite(i, N);
			}
			if (100 - a.y < 2*mid) {
				tree.unite(i, N+1);
			}
		}
		if (tree.is_same(N, N+1)) {
			bad = mid;
		} else {
			good = mid;
		}
	}
	writef(good);
}