//include
//------------------------------------------
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>

#include <numeric>
#include <utility>
#include <complex>

#include <sstream>
#include <iostream>
#include <iomanip>

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <ctime>

// namespace
using namespace std;

// type alias
using ll = long long;
using ull = unsigned long long;
using comp = complex<double>;

// constant
static const ll MOD = 998244353LL;
// static const ll MOD = (1LL << 61LL) - 1LL;
static const double PI = 3.14159265358979323846;

// conversion
inline ll toint(string s) { ll v; istringstream sin(s); sin >> v; return v; }
template<class t> inline string tostring(t x) { ostringstream sout; sout << x; return sout.str(); }

// print
#define RET(x) return cout << x << endl, 0;

// for loop
#define REP(i, a, b) for ((i) = (ll)(a);(i) < (ll)(b);(i)++)
#define REPD(i, a, b) for (ll i = (ll)(a);(i) < (ll)(b);(i)++)
#define REPI(v, vs) for (auto& v : vs)

//debug
#ifdef LOCAL_ENV
#define DUMP(x)  cerr << #x << " = " << (x) << endl
#define DEBUG(x) cerr << #x << " = " << (x) << " (l" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define DUMP(x)
#define DEBUG(x)
#endif

#define MAX_VALUE 9223372036854775807LL

template <ull N, class T, class... Args, std::enable_if_t<N == 0, int> = 0>
auto make_multiple_vector(Args... args) {
    return T(args...);
}

template <ull N, class T, class... Args, std::enable_if_t<N != 0, int> = 0>
auto make_multiple_vector(ull size, Args... args) {
    using value_type = std::decay_t<decltype(make_multiple_vector<N - 1, T>(args...))>;
    return vector<value_type>(size, make_multiple_vector<N - 1, T>(args...));
}

// computational complexity: o(log(max(a, b)))
template<class Integer>
inline pair<Integer, Integer> getBezoutsIdentitySolution(Integer a, Integer b)
{
	if (b == Integer(0)) return { Integer(1) / a, Integer(0) };
	auto sol = getBezoutsIdentitySolution(b, a % b);
	return { sol.second, sol.first - (a / b) * sol.second };
}

template<class Integer>
Integer getModValue(const Integer& n, Integer mod)
{
	return (n % mod + mod) % mod;
}

// computational complexity: o(log(max(n, mod)))
template<class Integer>
inline Integer getModInverse(const Integer& n, Integer mod)
{
	auto sol = getBezoutsIdentitySolution(n, mod);
	return getModValue(sol.first, mod);
}

int solve() {
	ll n, k;
	cin >> n >> k;

	vector<ll> as(n);
	REPD(i, 0, n) cin >> as[i];

	vector<ll> power2s(k + 1);
	power2s[0] = 1;
	REPD(i, 0, k) power2s[i + 1] = power2s[i] * 2LL % MOD;

	vector<ll> exclamations(k + 1);
	exclamations[0] = 1;
	REPD(i, 0, k) exclamations[i + 1] = exclamations[i] * (i + 1LL) % MOD;

	vector<ll> a_power_sums(k + 1);
	a_power_sums[0] = n % MOD;
	vector<ll> a_powers(n, 1);
	ll sum;
	REPD(i, 0, k) {
		sum = 0;
		REPD(j, 0, n) {
			a_powers[j] = a_powers[j] * as[j] % MOD;
			sum = (sum + a_powers[j]) % MOD;
		}
		a_power_sums[i + 1] = sum;
	}

	REPD(x, 1, k + 1) {
		sum = 0;
		REPD(i, 0, x + 1) {
			ll comb = exclamations[x] * getModInverse(exclamations[i], MOD) % MOD * getModInverse(exclamations[x - i], MOD) % MOD;
			sum = (sum + comb * a_power_sums[i] % MOD * a_power_sums[x - i] % MOD) % MOD;
		}
		sum = (sum - power2s[x] * a_power_sums[x] % MOD + MOD) % MOD;
		sum = sum * getModInverse(2LL, MOD) % MOD;
		cout << sum << endl;
	}

	return 0;
}

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

	solve();
	// ll t;
	// cin >> t;
	// REPD(i, 0, t) solve();

	return 0;
}

/*/ Author : Abhishek Chauhan /*/

#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;

// a+b = a^b + 2*(a&b)
// According to Fermat's little theorem, (a^b)%mod = ((a^(b%(mod - 1)))%mod) if mod is a prime number and not the other way round.
// whenever using a comparator return true only if a<b
// make it forward first if it doesnt work do the reverse
// vector a = ax + ay b = bx + by then dot porduct is |a||b|cos@ //and also for eas you can use (ax*bx)+(ay*by);

#define rep(i,n)             for(int i=0;i<n;i++)
#define int                  long long
#define pb                   push_back
#define mp                   make_pair
#define all(x)               x.begin(),x.end()
#define mod                  1000000007
#define bpop(x)              __builtin_popcountll((x))
#define fastio               ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl                 '\n'

template<class T>
using ordered_set = tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update> ;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;

template<class T>
T power(T x, T y){T res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
template<class T>
T powermod(T x, T y, T p){T res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}

const int N = 20;
vector<int>g[N];
int vis[N],col[N];
vector<int>order;

void get(int node){
  vis[node] = 1;
  order.pb(node);
  for(auto x:g[node]){
    if(vis[x]==0){
      get(x);
    }
  }
}

int recur(int i){
  if(i>=order.size()){
    return 1;
  }
  int res = 0;
  vis[order[i]] = 1;
  vector<int>can(4,1);
  for(auto x:g[order[i]]){
    if(col[x]!=0){
      can[col[x]] = 0;
    }
  }
  for(int c=1;c<4;c++){
    if(can[c]){
      col[order[i]] = c;
      res+=recur(i+1);
      col[order[i]] = 0;
    }
  }
  return res;
}

void snow(){

   int n,m;
   cin>>n>>m;
   for(int i=0;i<n;i++){
    vis[i] = 0;
    col[i] = 0;
   }
   for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;a--;b--;
    g[a].pb(b);
    g[b].pb(a);
   }
   int ans = 1;
   for(int i=0;i<n;i++){
    if(!vis[i]){
     order.clear();
     get(i);
     col[order[0]] = 1;
     vis[order[0]] = 1;
     ans=ans*3*recur(1);
    }
   }
   cout<<ans<<endl;
}

int32_t main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    fastio;
    int _;
    _=1;
    for(int i=1;i<=_;i++){
     // cout<<"Case #"<<i<<": ";
        snow();
    }
    return 0;
}


#include "bits/stdc++.h"
#define ll long long
#define lld long double
#define MOD 1000000007
#define inf 1000000000000000000LL
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll power(ll x,ll y, ll md=MOD){ll res = 1;x%=md;while(y){if(y&1)res = (res*x)%md;x *= x; if(x>=md) x %= md; y >>= 1;}return res;}

using namespace std;

#define endl '\n'
#define int long long

struct node {vector<ll> v,w;};

ll mod(ll &x,ll md=MOD){x=(x%md + md)%md;return x;}
ll mod(ll &&x,ll md=MOD){x=(x%md + md)%md;return x;}

#define mm 101

void multiply(int a[][mm], int b[][mm], int dim) {
  int c[mm][mm];
  for (int i = 0; i < dim; i++) {

    for (int j = 0; j < dim; j++) {
      int sum = 0;
      for (int k = 0; k < dim; k++) {
        sum += a[i][k] * b[k][j];
        mod(sum);
      }

      c[i][j] = sum;
    }
  }
  for (int i = 0; i < dim; i++) {
    for (int j = 0; j < dim; j++) {
      a[i][j] = c[i][j];
    }
  }
}

void matrixexponentiation(int arr[mm][mm], int dim, int power) {
  int I[mm][mm];
  for (int i = 0; i < dim; i++) {
    for (int j = 0; j < dim; j++) {
      if (i == j) {
        I[i][j] = 1;
      } else {
        I[i][j] = 0;
      }
    }
  }
  while (power != 1) {
    if (power % 2) {
      multiply(I, arr, dim);
      power--;
    } else {
      multiply(arr, arr, dim);
      power /= 2;
    }

  }
  multiply(arr, I, dim);
}

	int arr[101][101];
signed main() {
	fast;

	int n,m,k;
	cin>>n>>m>>k;

	vector<node> nodes(n);

	vector<int> a(n);
	for(auto &x: a) cin>>x;

	if(k==0) {
		for(auto x: a) cout<<x<<" ";
			exit(0);
	}

	set<pii> ed;

	vector<pii> q(m);
	for(int i=0;i<m;i++) {
		int u,v;
		cin>>u>>v;
		u--; v--;
		nodes[u].v.pb(v);
		nodes[v].v.pb(u);
		ed.insert({u,v});
		ed.insert({v,u});
	}

	for(int i=0;i<n;i++) {
		int num = nodes[i].v.size();
		arr[i][i] = 1 - (num) * power(2*m, MOD-2);
		mod(arr[i][i]);

		// cout<<(2*num + m)<<"/"<<2*num + 2*m<<endl;

		for(int j=0;j<n;j++) {
			if(j==i) continue;

			if(ed.count({i,j})) {
				arr[i][j] = power(2*m, MOD-2);
				// cout<<"#"<<i<<" "<<j<<" -- "<<2*num + 2*m<<endl;
			}
		}
	}

	// for(int i=0;i<n;i++) {
	// 	for(int j=0;j<n;j++) {
	// 		cout<<arr[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }

	matrixexponentiation(arr, n, k);

	for(int i=0;i<n;i++) {

		int val = 0;
		for(int j=0;j<n;j++) {
			val += mod(a[j] * arr[i][j]);
		}
		cout<<mod(val)<<endl;
	}

}

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#define ll long long
#define MAXN 300005
#define uns unsigned
#define INF 0x3f3f3f3f
#define MOD 1000000007ll
using namespace std;
inline ll read(){
	ll x=0;bool f=1;char s=getchar();
	while((s<'0'||s>'9')&&s>0){if(s=='-')f^=1;s=getchar();}
	while(s>='0'&&s<='9')x=(x<<1)+(x<<3)+s-'0',s=getchar();
	return f?x:-x;
}
inline ll ksm(ll a,ll b,ll mo){
	ll res=1;
	for(;b;b>>=1,a=a*a%mo)if(b&1)res=res*a%mo;
	return res;
}
struct matrix{
	int n,m;
	ll c[105][105];
	matrix(){memset(c,0,sizeof(c)),n=m=0;}
	matrix operator*(const matrix&b){
		matrix res;res.n=n,res.m=b.m;
		for(int i=1;i<=n;i++)
			for(int k=1;k<=m;k++)
				for(int j=1;j<=b.m;j++)
					res.c[i][j]=(res.c[i][j]+c[i][k]*b.c[k][j]%MOD)%MOD;
		return res;
	}
}a,b;
inline matrix mpow(matrix a,ll b){
	matrix res;res.n=res.m=a.n;
	for(int i=1;i<=res.n;i++)res.c[i][i]=1;
	for(;b;b>>=1,a=a*a)if(b&1)res=res*a;
	return res;
}
int n,m,k,du[105];
bool G[105][105];
int main()
{
	n=read(),m=read(),k=read();
	a.n=1,a.m=n,b.n=b.m=n;
	for(int i=1;i<=n;i++)a.c[1][i]=read();
	for(int i=1;i<=m;i++){
		int u=read(),v=read();
		G[u][v]=G[v][u]=1,du[u]++,du[v]++;
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			if(G[i][j])
				b.c[j][i]=(b.c[j][i]+ksm(m<<1,MOD-2,MOD))%MOD,
				b.c[i][i]=(b.c[i][i]+ksm(m<<1,MOD-2,MOD))%MOD;
		b.c[i][i]=(b.c[i][i]+ksm(m,MOD-2,MOD)*(m-du[i])%MOD)%MOD;
	}
	a=a*mpow(b,k);
	for(int i=1;i<=n;i++)printf("%lld\n",a.c[1][i]);
	return 0;
}


#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;
using oset = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
using int64 = long long;

void fastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}

struct ranges {
  int l, r, sum;
};

bool disjoint(pair<int,int> p1, pair<int,int> p2) {
  if (p1.first > p2.first)
    swap(p1, p2);
  return p1.second < p2.first;
}

bool disjoint(ranges p1, ranges p2) {
  if (p1.l > p2.l)
    swap(p1, p2);
  return p1.r < p2.l;
}

bool consec(pair<int,int> p1, pair<int,int> p2) {
  if (p1.first > p2.first)
    swap(p1, p2);
  return p1.second == p2.first - 1;
}

bool consec(ranges p1, ranges p2) {
  if (p1.l > p2.l)
    swap(p1, p2);
  return p1.r == p2.l - 1;
}

void test_case() {
  int N;
  cin >> N;
  vector<int> a(N + 1);
  vector<ranges> r;
  for (int i = 1; i <= N; ++i) {
    cin >> a[i];
    if (a[i] >= 200)
      a[i] %= 200;
    int sum = 0;
    for (int j = i; j > 0; --j) {
      sum += a[j];
      if (sum >= 200)
        sum -= 200;
      r.push_back({j, i, sum});
    }
  }
  vector<vector<pair<int,int>>> ways(200);
  int M = r.size();
  for (int i = 0; i < M - 1; ++i)
    for (int j = i + 1; j < M; ++j) {
      if (r[i].sum == r[j].sum) {
        cout << "Yes\n";
        cout << r[i].r - r[i].l + 1 << ' ';
        for (int k = r[i].l; k <= r[i].r; ++k)
          cout << k << ' ';
        cout << '\n';
        cout << r[j].r - r[j].l + 1 << ' ';
        for (int k = r[j].l; k <= r[j].r; ++k)
          cout << k << ' ';
        cout << '\n';
        return;
      }
      if (!disjoint(r[i], r[j]))
        continue;
      int new_sum = r[i].sum + r[j].sum;
      if (new_sum >= 200)
        new_sum -= 200;
      if (ways[new_sum].size() == 2) {
        if (consec(ways[new_sum][0], ways[new_sum][1]) && consec(r[i], r[j])
            && min(ways[new_sum][0].first, ways[new_sum][1].first) == min(r[i].l, r[j].l)
            && max(ways[new_sum][0].second, ways[new_sum][1].second) == max(r[i].r, r[j].r))
          continue;
        cout << "Yes\n";
        set<int> ind;
        for (int k = ways[new_sum][0].first; k <= ways[new_sum][0].second; ++k)
          ind.emplace(k);
        for (int k = ways[new_sum][1].first; k <= ways[new_sum][1].second; ++k)
          ind.emplace(k);
        cout << ind.size() << ' ';
        for (int x : ind)
          cout << x << ' ';
        cout << '\n';
        ind.clear();
        for (int k = r[i].l; k <= r[i].r; ++k)
          ind.emplace(k);
        for (int k = r[j].l; k <= r[j].r; ++k)
          ind.emplace(k);
        cout << ind.size() << ' ';
        for (int x : ind)
          cout << x << ' ';
        cout << '\n';
        return;
      }
      ways[new_sum].emplace_back(r[i].l, r[i].r);
      ways[new_sum].emplace_back(r[j].l, r[j].r);
    }
  cout << "No\n";
}

void solve() {
  int T = 1;
  for (int tc = 0; tc < T; ++tc)
    test_case();
}

int main() {
  fastIO();
  solve();
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N=205;
int n,a[N];
vector<int>v,res1,res2;
vector<int>save[N];
bool flag;
void dfs(int cur,int sum){
	sum%=200;
	if(flag)	return;
	if(cur==n+1){
		if(save[sum].size()&&v.size()){
			flag=true;
			res1=save[sum];
			res2=v;
		}
		else	save[sum]=v;
		return;
	}
	dfs(cur+1,sum);

	v.push_back(cur);
	dfs(cur+1,sum+a[cur]);
	v.pop_back();
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)	scanf("%d",&a[i]);
	dfs(1,0);
	if(flag){
		puts("Yes");
		cout<<res1.size()<<" ";
		for(int i=0;i<res1.size();i++)	cout<<res1[i]<<" ";
		puts("");
		cout<<res2.size()<<" ";
		for(int i=0;i<res2.size();i++)	cout<<res2[i]<<" ";
	}
	else	puts("No");
	return 0;
}
/*
鸽巢原理
如果n个巢里有kn+1个鸽子，那么至少有一个巢里面有kn+1个鸽子
*/


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#define rep(i,begin, end) for (ll i = begin; i < (ll)(end); i++)

using namespace std;
using ll = long long;

template<typename T>
using vec2 = vector<vector<T>>;
template<typename T>
using vec3 = vec2<vector<T>>;
template<typename T>
using vec4 = vec3<vector<T>>;
template<typename T>
using vec5 = vec4<vector<T>>;
template<typename T>
using vec6 = vec5<vector<T>>;

int gcd(int a, int b){
    if(b == 0)return a;
    return gcd(b, a%b);
}

ll extGCD(ll a, ll b, ll &x, ll &y){
    if(b == 0){
        x = 1;
        y = 0;
        return a;
    }
    ll g = extGCD(b, a%b, y, x);
    y -= a/b * x;
    return g;
}
//ax+by=cをみたす整数x,y
bool solveLinearEquation2(ll a, ll b, ll c, ll &x, ll &y){
    if(c % gcd(a,b) != 0)return false;
    /*
        (a/d)X+(b/d)Y=c/d
        (a/d)x+(b/d)y=1
        (a/d)(c/d)x+(b/d)(c/d)y=c/d
        X=(c/d)x-k(b/d)
        Y=(c/d)y+k(a/d)
        必要に応じてkを決める
    */
    ll d = extGCD(a,b,x,y);
    ll k = d<0 ? floor(min(((double)c/(double)b*(double)x), -(double)c/(double)a*(double)y)):
                ceil(max(((double)c/(double)b*(double)x), -(double)c/(double)a*(double)y));
    // cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
    x = (c/d)*x-k*(b/d);
    y = (c/d)*y+k*(a/d);

    return true;
}
ll MOD = 1000000007;

vector<ll> mfact(1,1);

ll minv(ll a){
    ll x;ll y;
    extGCD(a, MOD, x, y);
    if(x<0){
        x+= ((-x)/MOD+1)*MOD;
        x %= MOD;
    }
    return x;
}

ll mpow(ll a,ll b){
    ll res = 1;
    while(b > 0){
        if(b%2==1)res=(res*a)%MOD;
        b/=2;
        a = (a*a)%MOD;
    }
    return res;
}

ll mfactorial(ll a){
    if(mfact.size()-1 >= a)return mfact[a];
    for(ll i = mfact.size();i<=a;i++){
        mfact.push_back((i * mfact[i-1])%MOD);
    }
    return mfact[a];
}

ll mcomb(ll n, ll r){
    return (((mfactorial(n) * minv(mfactorial(r)))%MOD) * minv(mfactorial(n-r)))%MOD;
}
ll ipow(ll a, ll b){
    ll res = 1;
    while(b > 0){
        if(b % 2 == 1)res*=a;
        a*=a;
        b/=2;
    }
    return res;
}

void factorize(map<ll,ll>& fac, vector<ll>& sieved, ll a){
    while(a != 1){
        if(fac.find(sieved[a]) == fac.end())fac[sieved[a]] = 0;
        fac[sieved[a]]++;
        a/=sieved[a];

    }
}
void primesieve(vector<ll>& res,ll n){
    res = vector<ll>(n+1, -1);
    for(int i = 2;i <= n;i++){
        if(res[i] != -1)continue;
        res[i] = i;
        for(int j = 2;j*i <= n;j++){
            res[j*i] = i;
        }
    }
}
vector<ll> primesuntil(ll n){
    vector<ll> res;
    vector<ll> sieved;
    primesieve(sieved, n);
    for(int i = 2;i <= n;i++){
        if(sieved[i] == i)res.push_back(i);
    }
    return res;
}

void solve(){
    // cout<<"##########"<<endl;
    ll X,Y,P,Q;cin>>X>>Y>>P>>Q;
    ll res = -1;
    rep(q,0,Q){
        rep(y,0,Y){
            ll s,t;
            if(!solveLinearEquation2(2*X+2*Y, -(P+Q), P+q-X-y, s,t))continue;
            ll a = (2*X+2*Y)*s+X+y;
            if(res == -1)res = a;
            res = min(res,a);
            // cout<<a<<endl;
            // cout<<s<<" "<<t<<endl;
            // cout<<"!!!!!!!!!!!!!!!!"<<endl;

        }
    }

    cout<<(res==-1 ? "infinity" : to_string(res))<<endl;
}

int main(){
    int T;cin>>T;
    rep(i,0,T)solve();
}

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

// ap + bq = gcd(a, b) なる (p, q) を求め d = gcd(a, b) を返す
ll extgcd(const ll a, const ll b, ll &p, ll &q){
    if (b==0) { p=1; q=0; return a; }
    ll d = extgcd(b, a%b, q, p);
    q -= a/b * p;
    return d;
}

// x mod s = a, x mod t = b なる x >= 0 の最小値を求める。存在しなければ -1
ll solve(const ll a, const ll b, const ll s, const ll t){
    ll p, q;
    const ll d = extgcd(s, t, p, q);
    if ((a-b) % d != 0) return -1;
    const ll ret = a + s * (((b - a) / d * p) % (t / d));
    const ll s_lcm_t = s * t / d;
    return (ret % s_lcm_t + s_lcm_t) % s_lcm_t;
}

int main(){
    int t;
    cin >> t;
    for(int ti=0; ti<t; ++ti){
        ll x, y, p, q;
        cin >> x >> y >> p >> q;
        ll ret = -1;
        for(ll yi = 0; yi < y; ++yi){
            for(ll qi = 0; qi < q; ++qi){
                const ll v = solve(x + yi, p + qi, (x + y) * 2, p + q);
                if (v >= 0){
                    if(ret == -1){
                        ret = v;
                    }else{
                        ret = min(ret, v);
                    }
                }
            }
        }
        if(ret == -1){
            cout << "infinity" << endl;
        }else{
            cout << ret << endl;
        }
    }
    return 0;
}


#include <iostream>
using namespace std;
#define int long long
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
int LCM(int a, int b)
{
    return a/gcd(a, b)*b;
}
signed main()
{
    int n, m , s;

    cin>>n;
    s = 1;
    for (int i = 2; i <=n; i++)
        s = LCM(s, i);

    s++;

    cout<<s;

    return 0;
}

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

int main()
{

        long long n,m,a,b=13,c,d,e,f,g,h,p,q,r,fr,sc,tr,sz=0,tz,i,j,k,mx=LLONG_MIN,mn=LLONG_MAX;
        long long x=1,y=1,cnt=0,res=0,ans=1,sum=0; long long flg=0,flag=1,na=0,as=1;
        vector<long long>u,v,w; vector< pair<long long,long long> >vct; vector<string>vst;
        set<long long>st,nt,tt; map<long long,long long>mp,nq,qr; string str,ttr,ntr;

        cin>>n;

        ans=ans*2; mp[2]=1; ans=ans*3; mp[3]=1;

        g=2;

        for(i=3;i<=30;i++)
        {
            d=(g*i)/(__gcd(g,i));

            g=d;

        }

        //cout<<g<<endl;

        for(i=4;i<=30;i++)
        {

            fr=i;

            c=0;

            while(fr%2==0)
            {
                fr=fr/2; c++;  if(c>mp[2]){  mp[2]=c; ans=ans*2;  }
            }

            for(j=3;j*j<=fr;j+=2)
            {
                c=0;

                while(fr%j==0)
                {
                    fr=fr/j;  c++;  if(c>mp[j]){  mp[j]=c; ans=ans*j;   }
                }

            }

            c=0;

            if(fr!=1)
            {
                c=1;

                if(c>mp[fr]){  mp[fr]=c; ans=ans*fr;  }
            }

        }

        cout<<ans+1<<endl;

    return 0;
}


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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i < b; i++)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef string str;

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

	ll a,b,c;
	cin>>a>>b>>c;

    if(pow(a,2) + pow(b,2) < pow(c,2)){
        cout<<"Yes"<<"\n";
    }
    else{

        cout<<"No"<<"\n";
    }

}

#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;

#define ll long long

// const ll p = 998244353;
const ll nax = 100001;

int binpow(int a, int n, int p) {
	if (!n) return 1;
	if (n & 1) return binpow(a, n - 1, p) * a % p;
	return binpow(a * a % p, n / 2, p);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int a, b, c;
	cin >> a >> b >> c;
	a %= 10;
	if (a == 0 || a == 5) {
		cout << a;
		return 0;
	}
	vector<vector<int>> v = {{2, 4, 8, 6}, {4, 6}, {6}, {8, 4, 2, 6}};
	if (__gcd(a, 10) == 1) {
		b %= 4;
		cout << binpow(a, binpow(b, c, 4), 10);
		return 0;
	}
	a = a / 2 - 1;
	b %= v[a].size();
	int sh = binpow(b, c, v[a].size()) - 1;
	if (sh < 0) sh += v[a].size();
	cout << v[a][sh];
}


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#include<functional>
#include<iomanip>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define chartoint(c) (int)((c) - '0')
#define chartoll(c) (long long)((c) - '0')
#define bpc(x) __builtin_popcount(x)
#define bpcll(x) __builtin_popcountll(x)
#define fps(n) fixed << setprecision(n)
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define cotu cout
#define Endl endl
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<pair<int,int>> v(n);
    rep(i,0,n){
        int x,y; cin >> x >> y;
        v[i] = {x,y};
    }
    int ans = 0;
    rep(i,0,n){
        rep(j,i+1,n){
            if(abs(v[j].second-v[i].second) <= abs(v[j].first-v[i].first)) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
#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;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int inf=0x3f,INF=0x3f3f3f3f; const ll LLINF=0x3f3f3f3f3f3f3f3f;
#define siz(x) (int)x.size()
#define af(x) x.begin(), x.end()
#define ms(x, y) memset(x, y, sizeof x)
#define fil(x, y) fill(af(x), y)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define lc i << 1
#define rc i << 1 | 1
const int mod = 1e9 + 7;
ll fpow(ll a, ll b){ll ret=1;while(b){if(b&1)ret=ret*a%mod;a=a*a%mod,b>>=1;}return ret;}
ll inv(ll x){return x ? fpow(x, mod - 2) : 1;}
void madd(int &a, int b){a+=b;if(a>=mod)a-=mod;}
void msub(int &a, int b){a+=mod-b;if(a>=mod)a-=mod;}
const int MM = 2e5 + 5;

void solve(){
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	int ans = 0;
	for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
	for (int i = 0; i < n; i++){
		for (int j = i + 1; j < n; j++){
			double m = (b[i] - b[j]) * 1.0 / (a[i] - a[j]);
			if (m >= -1 && m <= 1) ans++;
		}
	}
	cout << ans << '\n';
}
/*
 * do i rlly need to check everything????
 */

int main(){
	cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t = 1;
	//cin >> t;
	while(t--) solve();
}


/**
*    author:  tomo0608
*    created: 14.03.2021 17:00:40
**/

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include<atcoder/all>
using namespace atcoder;
#endif

typedef long long ll;
typedef long double ld;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
typedef pair<int,int> pii;
typedef pair<long long, long long> pll;

#define all(x) x.begin(),x.end()
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define unique(a) a.erase(unique(a.begin(),a.end()),a.end())
template<class... T>void input(T&... a){(cin >> ... >> a);};
#define INT(...) int __VA_ARGS__; input(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__; input(__VA_ARGS__)
#define STRING(...) string __VA_ARGS__; input(__VA_ARGS__)
void print(){cout << '\n';}
template<class T, class... Ts>void print(const T& a, const Ts&... b){cout << a; (cout << ... << (cout << ' ', b)); cout << '\n';}
template<class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T> >;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T1, class T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<typename T> ostream& operator << (ostream& os, set<T>& set_var) {os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {os << *itr;++itr;if(itr != set_var.end()) os << ", ";itr--;}os << "}";return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) {os << "{";for(auto itr = map_var.begin(); itr != map_var.end(); itr++) {os << *itr;itr++;if (itr != map_var.end()) os << ", ";itr--;}os << "}";return os;}
template<class T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
#define pb push_back
#define eb emplace_back
#define elif else if
#define mp make_pair
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
template<typename T> T gcd(T x, T y){if(x%y == 0)return y;return gcd(y, x%y);}
template<typename T> T gcd(vector<T> a){T res = a[0];for(auto &x: a)res = gcd(res, x);return res;}
template <typename T>T mypow(T x, ll n){T ret = 1;while(n > 0){if(n & 1)(ret *= x);(x *= x);n >>= 1;}return ret;}
#define endl '\n'
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

void solve(){
    STRING(s);
    int n = s.size();
    if(s.compare("atcoder") > 0){
        print(0);
        return;
    }
    int now = 0;
    while(s[now] == 'a')now++;
    if(now == n){
        print(-1);
        return;
    }
    print(now - (s[now] > 't'));
    return;
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << setprecision(20);
    int codeforces = 1;
    cin >> codeforces;
    while(codeforces--){
        solve();
    }
    return 0;
}

//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 998244353
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<(n);i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll
// #define MAX 20
#define INF (int)1e18

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}

signed main()
{
	fio
	inp(a) inp(b) inp(c)
	int ans1=((a*(a+1))/2)%mod,ans2=((b*(b+1))/2)%mod,ans3=((c*(c+1))/2)%mod;
	// for(int i=1;i<=a;i++)
	// 	ans1=(ans1+i)%mod;
	// for(int i=1;i<=b;i++)
	// 	ans2=(ans2+i)%mod;
	// for(int i=1;i<=c;i++)
	// 	ans3=(ans3+i)%mod;
	int fans=(ans1*ans2)%mod;
	fans=(fans*ans3)%mod;
	cout<<fans<<'\n';
	printclock;
}


#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
template<class A, class B>void tostring(pair<A, B>p) { cerr<<"(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template<class A>void tostring(A v) {int f = 1;string r = "{";for (auto& x : v) {if (!f) {r += ", ";}f = 0;r += to_string(x);}r += "}\n";cerr<<r;}
void _out() { cerr << endl; }template<typename H, typename... T> void _out(H h, T... t) { cerr << ' ' << h; _out(t...); }
void show() { cerr << endl; }template<typename H, typename... T> void show(H h, T... t) { cerr<<h<<' '; show(t...); }
#define see(...) cerr << "(" << #__VA_ARGS__ << "):", _out(__VA_ARGS__)
#define rep(i, l, r) for(int i=(int)(l);i<=(int)(r);i++)
#define per(i, r, l) for(int i=(int)(r);i>=(int)(l);i--)
#define all(x) (x).begin(), (x).end()
#define all1(x) (x).begin()+1, (x).end()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
//#define int long long
typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vp; typedef vector<vp> vvp;
#define fi first
#define se second
const int N = 1e5+100;
//const int mod=1e9+7;
int h[N], e[2*N], ne[2*N],idx,col[N], bcol[N];
bool st[N];
vector<int>ans;
void add(int a, int b){
	e[idx] = b, ne[idx] = h[a], h[a] = idx ++;
}
void dfs(int u, int fa){
	if(!bcol[col[u]]){
		ans.pb(u);
	}
	bcol[col[u]] ++;
	for(int i = h[u]; i != -1; i = ne[i]){
		int j = e[i];
		if(j == fa)continue;
		dfs(j, u);
	}
	bcol[col[u]] --;
}
void solve() {
	memset(h, -1, sizeof h);
	int n;cin >> n;
	for(int i = 1; i <= n; i ++){
		cin >> col[i];
	}
	for(int i = 0; i < n - 1; i ++){
		int a, b;cin >> a >> b;
		add(a, b), add(b, a);
	}
	dfs(1, -1);
	sort(all(ans));
	rep(i, 0, ans.size() - 1)cout << ans[i] << endl;
}
signed main() {
	ios::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("E:\\in.txt", "r", stdin);
#endif
	solve();
}

#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;

#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define fp(i,a,b) for(ll i=a ; i<b ; i++)
#define fn(i,a,b) for(int i=a ; i>=b ; i--)
#define ones(x) __builtin_popcount(x)
#define pb push_back
#define mk make_pair
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define dbg(x) cout << (#x) << " = " << x << " "
#define fini cout << "\n";
#define line cout << "-----------------------------------\n";
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef tree<
ll,
null_type,
less_equal<ll>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

int read (){
    int x = 0, f = 1; char s = getchar();while (s < '0' || s > '9') {if (s == '-') f = -1; s = getchar();}
    while (s >= '0' && s <= '9') x = x * 10 + s - '0', s = getchar();
    return x * f;
}
const ll M=2e5+7;
const ll N=1e6+7;
const ll inf=1e18;
const ll mod=1e9+7;
const ll mod2=998244353;

int n;
int c[M];
vi adj[M];
map<int,int> d;
vi ans;

void dfs(int u,int p){
	if (!d.count(c[u]) || d[c[u]] == 0) ans.pb(u);
	d[c[u]]++;

	for (int v : adj[u])
		if (v != p) dfs(v, u);

	d[c[u]]--;
}

void go(int ide){
	cin >> n;

	fp(i,1,n+1) cin >> c[i];

	fp(i,1,n){
		int a,b; cin >> a >> b;
		adj[a].pb(b);
		adj[b].pb(a);
	}

	dfs(1, 1);
	sort(all(ans));

	for (int x : ans) cout << x << "\n";
}

int main(){
    fastio;
    int tst=1;
    // cin >> tst;
    // cout << fixed << setprecision(12);

    fp(i,0,tst) go(i+1);

    return 0;
}


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

int main() {
  int N, ans=0;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++)
    cin >> A.at(i);

  for(int i=0;i<N;i++){
    if(A.at(i) > 10)
      ans += A.at(i) -10;
  }
  cout << ans << endl;
}

#include <iostream>

using namespace std;
int main(){
    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 ans=0;
    for(int i=0; i<N; i++){
        ans+=A[i]*B[i];
    }
    if(ans==0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
//main sample
//by six_sigma
#define fastio ios::sync_with_stdio(false);cin.tie(0);
#define ll long long int
//defining loops
#define lp0(i,a) for(i=0;i<a;i++)
#define lp1(i,a) for(i=1;i<=a;i++)
//defining file input output(T.N.T.I)
#define f_input freopen("input.txt","r",stdin)
#define f_output freopen("output.txt","w",stdout)
//defining stl operations
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define vc vector<char>
#define si stack<int>
#define qi queue<int>
//defining input output
#define sf scanf
#define pf printf
#define endl "\n"

void solve(){
    ll a,i;
    double b;
    cin>>a>>b;

    double sum=0;
    double x,y;
    bool flag=false;
    lp0(i,a){
        cin>>x>>y;
        x*=(y/100);

        sum+=x;
        if(sum-b>(1e-6)){
            cout<<i+1<<endl;
            flag=true;
            break;
        }
    }
    if(!flag)cout<<-1<<endl;
}

int main(){
    fastio
    int t=1;

    while(t--)solve();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define Rep(i,j,n) for(int i=j; i<n; i++)
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//0000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
//#define P pair<ll, ll>
//#define P pair<double, double>
#define PP pair<P,P>
#define T tuple<int,int,int>

struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n,-1) {}
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) { return -d[find(x)];}
};

int main(){
  int n,m; cin >> n >> m;
  vector<int> a(n),b(n);
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> b[i];
  UnionFind u(n);
  rep(i,m){
    int c,d; cin >> c >> d;
    c--; d--;
    u.unite(c,d);
  }
  vector<vector<int> > g(n);
  rep(i,n){
    int w=u.find(i);
    g[w].push_back(i);
  }
  rep(i,g.size()){
    ll v,v2;
    v=v2=0;
    for(auto x : g[i]){
      v+=a[x]; v2+=b[x];
    }
    if(v!=v2){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  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;

signed main() {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> v[n];
    int x, y, z;
    rep(i, m) {
        cin >> x >> y >> z;
        x--;
        v[x].emplace_back(y, z);
    };
    ll dp[n + 1][1 << n];
    fill(dp[0], dp[n + 1], 0);
    dp[0][0] = 1;
    rep(i, n) {
        for (int bit = 0; bit < 1 << n; bit++) {
            if (!dp[i][bit]) continue;
            rep(use, n) {
                if (bit >> use & 1) continue;
                int nxt = bit | 1 << use;
                bool ng = false;
                for (auto p : v[i]) {
                    int cnt = 0;
                    rep(k, p.first) {
                        cnt += (nxt >> k) & 1;
                    }
                    if (cnt > p.second) {
                        ng = true;
                        break;
                    }
                }
                if (ng) continue;
                dp[i + 1][nxt] += dp[i][bit];
            }
        }
    }
    cout << dp[n][(1 << n) - 1] << endl;
    return 0;
}

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

int main(){
  int N;
  cin>>N;
  string S,T;
  cin>>S>>T;
  int ans=0;
  vector<int>A,B;
  for(int i=0,cnt=0;i<N;i++){
    if(S[i]=='0')A.push_back(i);
    if(T[i]=='0')B.push_back(i);
  }
  if(A.size()!=B.size()){
    cout<<"-1\n";return 0;
  }
  for(int i=0;i<A.size();i++){
    ans+=(A[i]!=B[i]);
  }
  cout<<ans<<'\n';
}


#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define For(i, a, b) for (ll i = (a); i <= (b); i++)
#define Forx(i, a, b, x) for (ll i = (a); i <= (b); i+=x)
#define debug(x) cout <<" || "<< #x << " is= " << x <<endl; //use for debug
#define read(a) ll a; cin >> a;
#define Ford(i, a, b) for (ll i = (a); i >= (b); i--)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long int
#define vi         vector<int>
#define vll        vector<ll>
#define vpii       vector<pair<int,int>>
#define pr         pair<ll,ll>
#define vpll       vector<pair<ll,ll>>
#define all(v)     v.begin(),v.end()
#define rall(v)    v.rbegin(),v.rend()  //reverse of above;
#define sz(container) int((container).size())
#define cut(x) {cout<<x<<"\n"; continue;}
#define setprec(x) cout << fixed << showpoint << setprecision(15)<<x<<"\n";
#define time cout << clock() / double(CLOCKS_PER_SEC) << endl;
#define endl '\n';
#define mod  1000000007
#define mod1 998244353
#define pi 3.141592653589793238
#define fi first
#define se second
using namespace std;
using namespace __gnu_pbds;
typedef tree<pr,null_type,less<pr>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

//░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

//*s.find_by_order() ->returns an iterator to the k-th largest element (counting from zero);
//s.order_of_key() ->number of elements strictly smaller then our item;
//st.rbegin()->second; last element in set
//st.erase(prev(st.end())); delete last element in set;
//sort(a+1,a+n+1,[](ll x,ll y){return abs(x)>abs(y);});
//sort(v.begin(), v.end(), greater<int>()); -> not sure work for first also if second are equal;
//q=lower_bound(all(v[a[i]]),i)-v[a[i]].begin()+1;
// s.substr(start_ind,length);
// vpll shift={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}} ->shift operator;
//bool comp(pr a,pr b){return a.second<b.second;} // use for differentiate order of comparision;
// cntbit(x) __builtin_popcount(x); -> no. of bits in given no.;
// true false; memset(dp,-1,sizeof(dp));
// std::random_shuffle(all(vec));
//using namespace std::chrono_literals;
//std::this_thread::sleep_for(-9999999999999ms);

//░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
const ll MAXN=1e6+5;
const ll inf=1e18;

int main()
{
  fast_io;
  //“Don’t wish it were easier. Wish you were better.” – Jim Rohn;
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif
  int n; cin>>n;
  long double x,y; cin>>x>>y;
  long double ans=0;
  while(n--)
  {
    long double x1,y1,height;
    cin>>x1>>y1;
    height=(y1-y)/(x1-x);
    height*=(-x1);
    height+=y1;
    //debug(height);
    ans=max(ans,height);
  }
  setprec(ans);
 }

#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <set>
#include <vector>
#include <queue>
#include <map>
#include <numeric>
#include <math.h>

using namespace std;

#define rep(i, n) for (long long int i = 0; i < (long long int)(n); i++)
#define irep(i, n) for (long long int i = 1; i <= (long long int)(n); i++)
#define drep(i, n, diff) for (long long int i = 0; i < (long long int)(n); i += diff)
#define mod 1000000007
#define cdeb(val) cout << #val << ":" << val << endl;
#define pdeb(val) printf("%s : %lld\n", #val, val);

typedef long long int ll;
typedef pair<ll, ll> P;

int main(){
  const ll INF = 1000000000000;
  ll n, m;
  cin >> n >> m;

  vector<ll> a(n);
  vector<ll> b(m);
  rep(i, n) {
    cin >> a[i];
  }
  rep(i, m) {
    cin >> b[i];
  }

  vector<vector<ll>> dp(n+1, vector<ll>(m+1, INF));

  dp[0][0] = 0;
  rep(i, n+1) {
    rep(j, m+1) {
      if (i < n) {
        dp[i+1][j] = min(dp[i+1][j], dp[i][j] + 1);
      }
      if (j < m) {
        dp[i][j+1] = min(dp[i][j+1], dp[i][j] + 1);
      }
      if (i < n && j < m) {
        ll cost = 0;
        if (a[i] != b[j]) cost = 1;
        dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + cost);
      }
    }
  }
  cout << dp[n][m] << endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define fon(i,n) for(int i=0;i<n;i++)
#define fo(i,n) for(int i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll ,ll>
#define vii vector<int>
#define vll vector<ll>
#define vvll vector<vll>
#define vpii vector<pii>
#define vpll vector<pll>
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define M (1000*1000*1000+7)
#define test ll T; cin>>T; while(T--)
#define all(z) z.begin() , z.end()
#define allr(z) z.rbegin() , z.rend()
// =============================================
//1.integer overflow (1e5 * 1e5) (2e9 + 2e9) // 2.runtime error //3.boundary condition

void solve()
{
    ll n , m , s = 0;
    cin >> n >> m;
    ll a[m+2]; a[0] = 0;
    fo(i , m)cin >> a[i];
    a[m+1] = n+1;
    sort(a , a+m+2);
    vll v;
    fo(i , m+1)
    {
        if((a[i]-a[i-1]-1) > 0)
        {
            v.pb(a[i]-a[i-1]-1);
        }
    }

    if(v.size()==0){
        cout << "0" << endl;
        return;
    }
    ll k = *min_element(all(v)) , ans = 0;
    for(ll j = 0 ; j < v.size() ; j++)
    {
        ans += (v[j]+k-1)/k;
    }
    cout << ans << endl;
}
int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);

   solve();
}

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  ll n, m; cin >> n >> m;
  vector<ll> a(m); for(int i = 0; i < m; i++) cin >> a[i];
  sort(a.begin(), a.end());
  a.insert(a.begin(), 0);
  a.push_back(n+1);

  vector<ll> v;
  ll k = n;
  for(int i = 0; i+1 < a.size(); i++) {
    ll len = a[i+1] - a[i] - 1;
    if(len > 0) {
      v.push_back(len);
      k = min(k, len);
    }
  }

  ll ans = 0;
  for(auto len: v) ans += (len+k-1) / k;
  cout << ans << endl;
  return 0;
}


#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
#define SZ(x) (int)((x).size())
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

const int N = 200 + 10;
int64 C[N][N];

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; ++j) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
  }
  cout << C[n - 1][11] << '\n';
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long int
#define mod 1000000007
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);

int main() {
    FIO;
    int n;
    cin>>n;
    int l = 1;
    int r = n;
    int ans = -1;
    while(l<=r){
        long long mid = (l+r)/2;

        if(((mid*(mid+1))/2)==n){
            ans = mid;
            break;
        }

        if(((mid*(mid+1))/2)>n){
            ans = mid;
            r = mid-1;
        }
        else{
            l = mid+1;
        }
    }
    cout<<ans<<endl;

    return 0;
}


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

int main() {
	int N;
	int maxA; int minB;
	cin >> N;
	vector<int>A(N); vector<int>B(N);

	for (int i = 0; i < N; i++) {
		cin >> A.at(i);
	}
	for (int i = 0; i < N; i++) {
		cin >> B.at(i);
	}
	 maxA = *max_element(A.begin(),A.end());
	 minB = *min_element(B.begin(), B.end());

	 if (minB-maxA+1 <= 0) {
		 cout << 0 << endl;
	 }
	 else if(minB-maxA+1>0){
		 cout << -maxA + minB + 1 << endl;
	 }
}

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

typedef long long ll;
typedef long double lxd;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;

#define mem(dp, a) memset(dp, a, sizeof dp)
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \

#define rep(i, a, b) for (ll i = a; i < b; i++)
#define repb(i, a, b) for (ll i = a; i >= b; i--)
#define f(i, n) for (ll i = 0; i < n; i++)
#define fo(i, n, x) for (ll i = x; i <= n; i++)
#define mp(a, b) make_pair(a, b)
#define pb(x) push_back(x)
#define make_graph(a, b) \
    adj[a].pb(b);        \
    adj[b].pb(a)
#define tr(c, it) for (((c).begin())it = (c).begin(); it != (c).end(); it++)
#define test   \
    ll tt;     \
    cin >> tt; \
    label:     \
    while (tt--)
#define fls fflush(stdout)
#define F first
#define S second
#define all(arr) arr.begin(), arr.end()
#define read(arr, n) f(i, n) cin >> arr[i]
#define INT_BITS 32

const ll mod = 1000000007;
const ll inf = 2e9 ;
const ll MAXN = 2e5 + 1;

main(){
    test{
        ll a, b ;
        cin >> a >> b ;

        if(b < 2*a){
            cout << "0\n" ; goto label ;
        }

        ll ans = max(0ll, b - (2*a)) + 1 ;

        cout << (ans * (ans + 1)) / 2 << "\n" ;

    }

}


/*Rabbi Zidni Ilma*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld",&n)
#define scll(n,m) scanf("%lld %lld",&n,&m)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define mod 1000000007
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout)

ll arr[200000],cumsum[200000];

int main()
{
    ll n,curr=0,i,ans=0;
    scl(n);

    for(i=0;i<n;i++)
    scl(arr[i]);

    sort(arr,arr+n);

    for(i=0;i<n;i++)
    {
    	cumsum[i]=curr+arr[i];
    	curr=cumsum[i];
	}
	for(i=0;i<n;i++)
    {
    	ans+=cumsum[n-1]-cumsum[i]-arr[i]*(n-1-i);
	}
    printf("%lld\n",ans);
}

#include<iostream>
using namespace std;

int main(){

	int n;
	cin>>n;

	int ans = 0;
	for(int i = 0; i < n; i++){
		int d;
		cin>>d;

		if(d > 10){
			ans += d - 10;
		}
	}
	cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
   long long n,i,k,t,ans=0;
   cin>>n;
   unordered_map<long long,long long>  mp;
   for(i=0; i<n; i++){
     cin>>k;
     t = k%200;
     mp[t]++;
   }
   for(auto x : mp){
      if(x.second>1){
         for(i=1; i<x.second; i++){
            ans = ans + i;
         }
      }
   }
 cout<<ans;
   return 0;
}

/*
**  Author: Kartikey Tewari
**  Time: 10-04-2021  13:06:53
*/

#include <bits/stdc++.h>
#define ll long long
#define mod (ll)998244353
using namespace std;

ll power (ll a, ll b)
{
    ll ans=1;
    while (b>=1)
    {
        if (b%2==1)
        {
            ans=(ans*a)%mod;
            b--;
        }
        else
        {
            a=(a*a)%mod;
            b=b/2;
        }
    }

    return ans;
}

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

    ll n;
    cin >> n;
    vector<ll> arr(n);
    for (ll i=0;i<=n-1;i++)
    {
        cin >> arr[i];
    }

    sort(arr.begin(),arr.end());
    ll ans=0;
    ll pre=0;
    for (ll i=0;i<=n-1;i++)
    {
        ans=(ans+((pre*arr[i])%mod))%mod;
        pre=((pre*2)%mod+arr[i])%mod;
    }

    for (ll i=0;i<=n-1;i++)
    {
        ans=(ans+power(arr[i],2))%mod;
    }

    cout << ans << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)

int main() {
    int n;
    cin >> n;
    const int INF = 1001001001;
    int l = 0, r = INF;
    rep(i, n) {
        int a;
        cin >> a;
        l = max(l, a);
    }
    rep(i, n) {
        int b;
        cin >> b;
        r = min(r, b);
    }
    int ans = r-l+1;
    ans = max(0, ans);
    cout << ans << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define all(x) sort(x.begin(),x.end())
#define int long long
#define pb push_back
#define pii pair<int,int>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define mod 1e9+7
#define inf 1e18
#define garou99 ios_base::sync_with_stdio(false); cin.tie(NULL);
int pow(int p,int r,int m){
	int ans=1;
	while(r>0){
     if(r&1){
		 ans=((ans%m)*(p%m))%m;
	 }
	 r=r>>1;
     p=((p%m)*(p%m))%m;
	}
	return ans;
}
int32_t main(){
	garou99;
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	int n;
	cin>>n;
	int a[n],b[n];
	rep(i,0,n)
	cin>>a[i];
	rep(i,0,n)
	cin>>b[i];
    set<int> x;
    rep(i,a[0],b[0]+1)
    x.insert(i);
    rep(i,1,n){
    	set<int> s;
    	rep(j,a[i],b[i]+1)
    	s.insert(j);
    	set<int> an;
         for(auto j:s){
         	if(x.find(j)!=x.end())
         		an.insert(j);
    	}
    	x=an;
    }
    cout<<x.size();
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using tiii = tuple<int,int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
int cnt_gcj = 0;
#define gcj_put cout<<"Case #" << ++cnt_gcj << ": ";

/* Coding Space */
int table[1502][1502];
bool used[1502][1502];
bool dfs(int y, int x, bool state,int cnt,bool vec){
  if(table[y][x] == 2){return state;}
  else if(table[y][x] == 1){
    bool ret = 0;
    if(vec == 0){
      ret = dfs(y+1,x,1,cnt+1,vec);
    }
    else{
      ret = dfs(y,x+1,1,cnt+1,vec);
    }
    return ret;
  }else{
    bool ret = (vec == 0?dfs(y+1,x,state,cnt+1,vec):dfs(y,x+1,state,cnt+1,vec));
    if(ret == 0) return 0;
    else{
      if(used[y][x]) ;
      else used[y][x] = 1;
      return ret;
    }
  }
}
int main(){
  int h,w,n,m; cin >> h >> w >> n >> m;

  rep(i,n){
    int a,b; cin >> a >> b;
    table[a][b] = 1;
  }
  rep(i,m){
    int a,b; cin >> a >> b;
    table[a][b] = 2;
  }
  rep(i,w+1) table[0][i] = 2,table[h+1][i] = 2;
  rep(i,h+1) table[i][0] = 2, table[i][w+1] = 2;

  rep(i,h+1)rep(j,w+1)if(table[i][j] == 2)dfs(i+1,j,0,0,0),dfs(i,j+1,0,0,1);
  ll ans = 0;
  //rep(i,h+1)rep(j,w+1){if(table[i][j] == 1 || used[i][j] == 1) cerr << i << ' ' << j << endl;}
  rep(i,h+1)rep(j,w+1){if(table[i][j] == 1 || used[i][j] == 1) ans++;}
  cout << ans << endl;
  return 0;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"

#include <iostream> // IO
#include <cmath> // sqrt, trig, ceil, log
#include <utility> // swap, pair

// #include <algorithm> // sort, binary search, reverse, merge
// #include <bitset>
// #include <cstdio>
// #include <cstdlib> //abs, atoi, rand
// #include <iterator>
// #include <map>
// #include <queue>
// #include <set>
// #include <stack>
// #include <string> // std string
// #include <vector>

// #include <chrono> // non c style time
// #include <complex>
// #include <deque>
// #include <iomanip> // setprecision
// #include <tuple>

#define fo(i, a, b) for(i=a; i<=b; i++)
#define ro(i, b, a) for(i=b; i>=a; i--)
#define foe(it, x) for(auto it=x.begin(); it!=x.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define fil(x, y) memset(x, y, sizeof(x))
#define deb(x) cout << #x << " " << x << "\n"
#define sz(a) ((int)(a.size()))

using namespace std;

using ll = long long;

const int N = 1e5+3;
const int inf = 1e9+3;
const ll M = 1e9+7;
const ll T = 998244353;
const double pi = acos(-1);

void solve()
{
	int a,b,x,y,fi,si;cin>>a>>b>>x>>y;
	if(b<a){
		fi = x;
		si = min(y,2*x);
		cout << fi + abs(b-(a-1))*si << "\n";
	}
	else {
		fi = x;
		si = min(y,2*x);
		cout << fi + abs(b-a)*si << "\n";
	}
}

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

	#ifdef Holmes7
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif

	int _t=1,i;
	//cin >> _t;
	for(i=1;i<=_t;i++){
		//cout << "Case #" << i << ": ";
		solve();
	}
	return 0;
}


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

// Type alias
using ll = long long;
using ld = double;

using pi = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
using ti3 = tuple<int, int, int>;

using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;
using vpi = vector<pi>;
using vpll = vector<ll>;
using vpld = vector<ld>;
using vti3 = vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max() / 2;
const ll llinf = numeric_limits<ll>::max() / 2;
const ll mod = 1e9 + 7;

// Macro
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define rrep(i, n) for (int i = int(n - 1); i >= 0; --i)
#define REP(i, a, b) for (int i = int(a); i < int(b); ++i)
#define RREP(i, a, b) for (int i = int(b - 1); i >= int(a); --i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a, n)                                                              \
  for (int i = 0; i < int(n); ++i)                                             \
  cout << #a << "[" << i << "]"                                                \
       << " = " << a[i] << endl

#define ALL(a) a.begin(), a.end()

// Funtcions
ll pow(ll base, ll i, ll mod) {
  ll a = 1;
  while (i) {
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b) {
  while (b) {
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <typename T> bool chmin(T &a, const T &b) {
  if (a > b)
    return a = b, true;
  else
    return false;
}

template <typename T> bool chmax(T &a, const T &b) {
  if (a < b)
    return a = b, true;
  else
    return false;
}

struct hoge {
  ll color, left, right;
};

void solve() {
  ll n;
  cin >> n;
  pll xc[200000 + 5];
  rep(i, n) {
    ll t, u;
    cin >> t >> u;
    xc[i] = make_pair(u, t);
  }

  sort(begin(xc), xc + n);

  vector<hoge> a;
  hoge b;
  b.color = xc[0].first;
  b.left = xc[0].second;
  a.push_back(b);
  for (ll i = 1; i < n; i++) {
    if (xc[i - 1].first != xc[i].first) {
      a[a.size() - 1].right = xc[i - 1].second;
      hoge b;
      b.color = xc[i].first;
      b.left = xc[i].second;
      a.push_back(b);
    }
  }
  a[a.size() - 1].right = xc[n - 1].second;

  vector<vector<pll>> d(a.size(), vector<pll>(2, make_pair(llinf, 0)));
  d[0][0] = make_pair(abs(a[0].left) + abs(a[0].right - a[0].left), a[0].right);
  d[0][1] = make_pair(abs(a[0].right) + abs(a[0].left - a[0].right), a[0].left);

  for (ll i = 1; i < a.size(); i++) {
    d[i][0] =
        make_pair(min(d[i - 1][0].first + abs(d[i - 1][0].second - a[i].left) +
                          abs(a[i].left - a[i].right),
                      d[i - 1][1].first + abs(d[i - 1][1].second - a[i].left) +
                          abs(a[i].left - a[i].right)),
                  a[i].right);
    d[i][1] =
        make_pair(min(d[i - 1][0].first + abs(d[i - 1][0].second - a[i].right) +
                          abs(a[i].left - a[i].right),
                      d[i - 1][1].first + abs(d[i - 1][1].second - a[i].right) +
                          abs(a[i].left - a[i].right)),
                  a[i].left);
  }

  cout << min(d[a.size() - 1][0].first + abs(d[a.size() - 1][0].second),
              d[a.size() - 1][1].first + abs(d[a.size() - 1][1].second))
       << endl;
}

int main() {
  // FastIO
  // ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}

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

#define pb push_back

#define int ll
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;

template<typename T, typename U>
ostream& operator<<(ostream& o, const pair<T,U>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}

template<typename T, typename U>
ostream& operator<<(ostream& o, const map<T,U>& m) {
  o << "{";
  for (const pair<T,U>& p : m)
    o << p.first << ": " << p.second << ",";
  return o << "}";
}

template<typename T>
ostream& operator<<(ostream& o, const set<T>& s) {
  o << "{";
  for (const T& e : s)
    o << s << ",";
  return o << "}";
}

template<typename T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (const T& x : v)
    o << x << ",";
  return o << "]";
}

template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T>>& v) {
  o << "[";
  for (const vector<T>& x : v)
    o << x << ",\n";
  return o << "]";
}

const int INF = 1e18;

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int a, b;
  cin >> a >> b;
  if (a == b) {
    for (int i=1; i<=a; ++i)
      cout << i << " -" << i << " ";
    cout << "\n";
    return 0;
  }
  string bsign = "-";
  string asign = "";
  if (a > b) {
    swap(a, b);
    swap(asign, bsign);
  }
  assert(a < b);
  for (int i=1; i<=b; ++i)
    cout << bsign << i << " ";
  for (int i=1; i<a; ++i)
    cout << asign << i << " ";
  int sum = 0;
  for (int i=a; i<=b; ++i)
    sum += i;
  cout << asign << sum << "\n";
}


#include <bits/stdc++.h>
#define lc (o<<1)
#define rc ((o<<1)|1)
#define PB push_back
#define MK make_pair
using namespace std;
#define DebugP(x) cout << "Line" << __LINE__ << " " << #x << "=" << x << endl

const int maxn = 5000 + 5;
const int modu = 998244353; // 1e9 + 7
const int inf = 0x3f3f3f3f;
const double eps = 1e-5;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

typedef long long LL;

void read(LL &x)
{
    x=0;int f=0;char ch=getchar();
    while(ch<'0'||ch>'9')  {f|=(ch=='-');ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
    x=f?-x:x;
    return;
}

void read(int &x) { LL y; read(y); x = (int)y; }
void read(char &ch) { char s[3]; scanf("%s", s); ch = s[0]; }
void read(char *s) { scanf("%s", s); }
template<class T, class ...U> void read(T &x, U& ... u) { read(x); read(u...); }

int n, m;
int a[maxn];
LL inv[maxn], c[maxn], f[20][maxn];
int b[20];

int main() {
    // freopen("my.txt", "w", stdout);
    read(n, m);
    inv[1] = 1;
    for (int i = 2; i <= n; ++i)
        inv[i] = (modu - (modu/i))*inv[modu%i]%modu;
    c[0] = 1;
    for (int i = 1; i <= n; ++i)
        c[i] = (n-i+1)*inv[i]%modu*c[i-1]%modu;
    int nb = 0;
    while (m) {
        b[nb++] = m%2;
        m /= 2;
    }
    memset(f, 0, sizeof(f));
    f[nb-1][0] = 1;
    int tot = b[nb-1];
    for (int i = nb-2; i >= 0; --i) {
        for (int j = 0; j <= tot*2 + b[i]; ++j) if (j%2 == 0) {
            for (int k = 0; k <= j && k <= n; k += 2)
                f[i][j] = (f[i][j] + f[i+1][(j-k)/2]*c[k]) % modu;
        }
        tot = tot*2 + b[i];
    }
    printf("%lld\n", f[0][tot]);
	return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#define rep(i, n) for(int i=0; i<n; i++)
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    if(n%2==0) cout << "White" << endl;
    else cout << "Black" << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define loops(i, s, n) for (ll i = s; i < (ll)n; i++)
#define loop(i, n) loops(i, 0, n)
#define ALL(a) a.begin(), a.end()
#define pub push_back
#define pob pop_back
#define mp make_pair
#define dump(x) cerr << #x << " = " << (x) << endl;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vl;

// for dp
// 第一引数と第二引数を比較し、第一引数(a)をより大きい/小さい値に上書き
template <typename T>
inline bool chmin(T &a, const T &b)
{
  bool compare = a > b;
  if (a > b)
    a = b;
  return compare;
}
template <typename T>
inline bool chmax(T &a, const T &b)
{
  bool compare = a < b;
  if (a < b)
    a = b;
  return compare;
}

#define in_v(type, name, cnt) \
  vector<type> name(cnt);     \
  loop(i, cnt) cin >> name[i];
#define sort_v(v) std::sort(v.begin(), v.end())
#define unique_v(v) v.erase(std::unique(v.begin(), v.end()), v.end()) //必ずソート後に実行

#define set_fix(x) ((std::cerr << std::fixed << std::setprecision(x)), (std::cout << std::fixed << std::setprecision(x)))

//cout for vector
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v)
{
  o << "{";
  for (int i = 0; i < (int)v.size(); i++)
    o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}

// gcd
ll gcd(ll a, ll b)
{
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
ll lcm(ll a, ll b)
{
  return a * b / gcd(a, b);
}

//prime numbers
bool IsPrime(ll num)
{
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;

  double sqrtNum = sqrt(num);
  for (ll i = 3; i <= sqrtNum; i += (ll)2)
  {
    if (num % i == 0)
    {
      return false;
    }
  }
  return true;
}
vector<ll> Eratosthenes(ll N)
{
  int arr[N];
  vector<ll> res;
  for (int i = 0; i < N; i++)
  {
    arr[i] = 1;
  }
  for (int i = 2; i < sqrt(N); i++)
  {
    if (arr[i])
    {
      for (int j = 0; i * (j + 2) < N; j++)
      {
        arr[i * (j + 2)] = 0;
      }
    }
  }

  for (int i = 2; i < N; i++)
  {
    if (arr[i])
    {
      res.push_back(i);
    }
  }
  return res;
}

//digit number
int GetDigit(ll num, ll radix)
{
  unsigned digit = 0;
  while (num != 0)
  {
    num /= radix;
    digit++;
  }
  return digit;
}

int digsum(ll n)
{
  ll res = 0;
  while (n > 0)
  {
    res += n % (ll)10;
    n /= (ll)10;
  }
  return res;
}
bool isConsistOfOnly5(ll n)
{
  if (n == 1)
    return false;
  bool ret = true;
  while (n > 1)
  {
    if (n % 5 != 0)
      ret = false;
    n /= 5;
  }
  return ret;
}
ll func(ll n, ll a)
{
  ll ret = 0;
  while (n > 1)
  {
    n /= a;
    ++ret;
  }
  return ret;
}
int main()
{
  ll n;
  cin >> n;
  for (ll a = 3; a < n; a *= 3)
  {
    ll b = n - a;
    if (isConsistOfOnly5(b))
    {
      cout << func(a, 3) << ' ' << func(b, 5) << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll           long long int
#define vint         vector<int>
#define vll          vector<ll>
#define vstr         vector<string>
#define vvint        vector<vector<int> >
#define vvll         vector<vector<ll> >
#define vip          vector<pair<int,int> >
#define vlp          vector<pair<ll,ll> >
#define input(arr)   for(auto &x:arr) cin>>x;
#define all(x)       (x).begin(), (x).end()
#define rall(x)      (x).rbegin(), (x).rend()

const int N = 100005;
const ll mod = 1000000007;
const ll inf = 1e17;
const long double pi = (acos(-1));

bool csort(const pair<int,int>&a, const pair<int,int>&b){
    return a.second < b.second;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n; cin>>n;
    vint arr(n); input(arr);
    int sum = accumulate(all(arr),0);
    vector<vector<bool>> dp(n+1, vector<bool>(sum+1,false));
    for(int i=0;i<=n;++i)
        dp[i][0] = true;
    for(int i=1;i<=n;++i){
        for(int j=1;j<=sum;++j){
            if(j<arr[i-1])
                dp[i][j] = dp[i-1][j];
            else
                dp[i][j] = dp[i-1][j] || dp[i-1][j-arr[i-1]];
        }
    }
    int i = sum/2 + (sum&1);
    //cout<<i<<endl;
    while(i<=sum && (!dp[n][i])){
        ++i;
    }
    cout<<i;
}

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long LL;
int n;
int a[105],dp[105][100005];
int main(){
    cin>>n;
    int sum=0;
    for(int i=1;i<=n;i++)cin>>a[i],sum+=a[i];
    dp[0][0]=1;
    for(int i=0;i<n;i++)
     for(int j=0;j<=sum;j++){
        if(dp[i][j]){
        	dp[i+1][j]=1;
        	dp[i+1][j+a[i+1]]=1;
		}
	 }
	 for(int i=(sum%2==0)?(sum/2):(sum/2+1);i<=sum;i++)
	 if(dp[n][i]){
	 	cout<<i;
	 	break;
	 }
	return 0;
}


	#include<bits/stdc++.h>
	using namespace std;
	#define ll long long int
	#define pb push_back

	int n,k,u,v;
	vector<int> adj[200002];
	vector<int> leaf;
	int cnt = 0;
	bool vis[200002];
	int dfs(int u , int t){
		vis[u] = true;
		int cur = 0;
		int rec = 0;
		for(int i=0;i<adj[u].size();i++){
			if(!vis[adj[u][i]]){
				int temp = dfs(adj[u][i],t);
				cur = max(cur,1+temp);
				rec = min(rec,1+temp);
			}
		}
		rec = - rec;
		if(cur < rec){
			cur = -rec;
		}

		if(cur == t){
			cur = -t-1;
			++cnt;
		}
	//	cout<<u<<" "<<cur<<"\n";
		return cur;
	}
	bool poss(int t){
		//cout<<t<<"\n";
		for(int i=0;i<n;i++)
			vis[i] = false;
		cnt = 0;
		int c = dfs(0,t);
		 if(c>=0){
		 	++cnt;
		 }
		 if(cnt<=k)
		 	return true;
		 else
		 	return false;
	}
	int main()
	{
		cin>>n>>k;
		for(int i=0;i<n-1;i++){
			cin>>u>>v;
			--u,--v;
			adj[u].pb(v);
			adj[v].pb(u);
		}
		if(k>=n){
			cout<<0;
			return 0;
		}
		int l = 1;
		int r = (n/2) + 1;
		int ans = -1;
		while(l<=r){
			int mid = (l+r)/2;
			if(poss(mid)){
				ans = mid;
				r = mid-1;
			}else{
				l = mid+1;
			}
		}
		cout<<ans;
		return 0;
	}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

int vi[200001];

vector<int> g[200001];

ll A[200001], b[200001];

ll ans=-1000000001;

ll maxi[200001];

void predfs(int u)
{
    vi[u]=1;

    for(int j=0;j<g[u].size();j++)
    {
        int v=g[u][j];
        if(!vi[v])
        {
            predfs(v);
        }
        maxi[u]=max(maxi[u], maxi[v]);
        maxi[u]=max(maxi[u], A[v]);
    }
}

int main()
{
    int N, M;
    cin >> N >> M;
    memset(vi, 0, sizeof vi);

    for(int i=1;i<=N;i++)
    {
        cin >> A[i];
        maxi[i]=-1000000001;
    }

    int X, Y;

    for(int i=0;i<M;i++)
    {
        cin >> X >> Y;
        g[X].push_back(Y);
    }

    for(int i=1;i<=N;i++)
    {
        if(!vi[i])
        {
            predfs(i);
        }
    }

    for(int i=1;i<=N;i++)
    {
        vi[i]=0;
        ans=max(ans, maxi[i]-A[i]);
    }
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cerr.tie(0);
#define mod 1000000007
#define decimal(n,k) cout<<fixed<<setprecision(k)<<n<<endl
#define LL_MAX LLONG_MAX
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
int exp(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int modinv(int x){return exp(x,mod-2);}
int add(int a,int b){a%=mod,b%=mod;a=((a+b)%mod+mod)%mod;return a;}
int sub(int a,int b){a%=mod,b%=mod;a=((a-b)%mod+mod)%mod;return a;}
int mul(int a,int b){a%=mod,b%=mod;a=((a*b)%mod+mod)%mod;return a;}
int gcd(int a, int b){if (b == 0)return a; return gcd(b, a % b);}
int Log2n( int n){ return (n > 1) ? 1 + Log2n(n / 2) : 0;}
int fac[100009];int ncr_mod(int n,int k){int ans=fac[n];ans*=modinv(fac[k]);ans%=mod;ans*=modinv(fac[n-k]);ans%=mod;return ans;}
vector<int>v_prime;void Sieve(int n){bool prime[n + 1];memset(prime,true,sizeof(prime));for (int p = 2; p*p <=n;p++){if(prime[p] ==true) {for(int i = p*p; i<= n; i += p)prime[i]=false;}}for(int p = 2;p<= n;p++)if (prime[p])v_prime.pb(p);}
vector<int>v_factor;void factors(int n){ for (int i=1; i<=sqrt(n); i++) {if (n%i == 0) {if (n/i == i) v_factor.pb(i);else { v_factor.pb(i),v_factor.pb(n/i);};} } sort(all(v_factor)); }
void out(vector<int>&a){for(int i=0;i<a.size();i++) cout<<a[i]<<" ";  cout<<endl;}

// s.top().second;

signed main()
 {

       run;

/*
open for mod factorial

     fac[0]=1;
       for(int i=1;i<100009;i++)
      {
         fac[i]=fac[i-1]*i;
          fac[i]%=mod;
      }
 */

/*
for sieve open this and use v_prime

       int pp=pow(10,6)+100000;
          Sieve(pp);

*/

 // USE v_factor For calculating factors

int  t=1;
 //cin>>t;
 while(t--)
{
         // vector< pair <int,int> > vp;
        //  map<int,int>mp; // x.second-->frequency
       //   set<int>st;

          int  n,i,x,y,ok=0,sum=0,ans=0,j,k,cnt=0,m,c=0;
          int  h[100009]={0};

                cin>>n;
                double res=0;

               for(i=1;i<n;i++)
               {
                   res+=(double)n/(n-i);
               }
               decimal(res,11);
}
}

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

int main(){
    string X;
    cin>>X;
    string Y;
    int N=X.size();
    for(int i=0;i<N;i++){
        if(X[i]=='.'){
            break;
        }
        else{
            cout<<X[i];
        }
    }
}


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

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

  ll ans=0;
  rep(i,n){
    ll a,b;
    std::cin >> a>>b;

    ll add=(a+b)*(b-a+1)/2;
    ans+=add;
  }
  std::cout << ans << '\n';

  return 0;
}

#include<iostream>
using namespace std;
const int N=1e6+10;
int a[N];
int main(){
	int n;
	cin>>n;
	int sum=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]>10){
			sum=sum+(a[i]-10);
		}
	}
	cout<<sum;
	return 0;
}


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

int judge(int a,int b){
  int c=a+b;
  if(c>=15&&b>=8){
    cout << 1 << endl;
  }
  else if(c>=10&&b>=3){
    cout << 2 << endl;
  }
  else if(c>=3){
    cout << 3 << endl;
  }
  else{
    cout << 4 << endl;
  }
  return 0;
}

int main(){
  int a,b;
  cin >> a >> b;
  judge(a,b);
}

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
inline void read(int& x){
	static char c;
	while(!isdigit(c=getchar()));x=c^48;
	while(isdigit(c=getchar()))x=(x*10)+(c^48);
}
inline void read(ll& x){
	static char c;
	while(!isdigit(c=getchar()));x=c^48;
	while(isdigit(c=getchar()))x=(x*10)+(c^48);
}

int A,B;

inline void Work(){
	read(A),read(B),A+=B;
	if(A>=15&&B>=8) return puts("1"),void();
	if(A>=10&&B>=3) return puts("2"),void();
	if(A>=3) return puts("3"),void();
	puts("4");
}

int main(){Work();}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//turn on extra precision
//#pragma GCC target("fpmath=387")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef string str;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
#define fbo find_by_order
#define ook order_of_key
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(),x.rend()
#define watch(x) cout << (#x) << " is : " << (x) << newl

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
vi dirx = {0,0,1,-1};
vi diry = {1,-1,0,0};
char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 122) return char(x-32);
    if( 65 <= int(x) && int(x) <= 90) return x;
    return -1;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 122) return x;
    if( 65 <= int(x) && int(x) <= 90) return char(x+32);
    return -1;
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57) return int(x-'0');
    if(97 <= int(x) && int(x) <= 122) return int(x-96);
    if(65 <= int(x) && int(x) <= 90) return int(x-64);
    return -1;
}
bool isect (int l1, int r1, int l2, int r2){ return max(l1,l2) <= min(r1,r2); }
ll quickpow (ll num1, ll num2, ll MOD){
    if(num2==0)return 1%MOD;
    else if(num2==1)return num1%MOD;
    else{
        ll temp = quickpow (num1,num2>>1LL,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2&1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return quickpow (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/__gcd(num1,num2))*num2;}
// end of Template

int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    str s; cin >> s;
    for(int i = 0; i < s.size(); ++i){
        if(i % 2 == 0){
            if(s[i] == to_lower(s[i])) continue;
            else {return cout << "No\n", 0;}
        }
        else{
            if(s[i] == to_upper(s[i])) continue;
            else {return cout << "No\n", 0;}
        }
    }
    cout << "Yes\n";

    return 0;
}

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

int main(){
	char c;
	bool o = 0, f = 0;
	while((c = getchar()) > 64){
		if(o != (c<97)){
			f = 1;
			break;
		}
		o = !o;
	}
	cout << (f? "No" : "Yes") << endl;
}


#include <bits/stdc++.h>

using namespace std;

long long count_inward(long long B, long long C){
  long long ans = 1;

  if(C){
    if(B > 0){
      ans++;
    }

    if(B < 0){
      B *= -1;
      C--; ans++;
    }
  }

  if(B == 0 or C == 0) return ans;

  long long k = min(B-1, (C-1)/2);
  ans += 2*k; C -= 2*k; B -= k;
  if(C >= 2) ans++;

  return ans;
}

long long count_outward(long long B, long long C){
  long long ans = 0;

  if(B > 0 and C){
    B *= -1; C--;
  }

  if(C == 0) return ans;

  long long k = (C-1)/2;
  ans += 2*k; C -= 2*k; B -= k;
  if(C >= 2) ans++;

  return ans;
}

int main(){
  long long B, C;
  while(scanf("%lld%lld", &B, &C) > 0){
    printf("%lld\n", count_inward(B, C) + count_outward(B, C));
  }
}

#include <bits/stdc++.h>

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

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

  int64 b, c;
  cin >> b >> c;
  int64 l1 = b - c / 2;
  int64 u1 = b + max(c - 2, 0LL) / 2;
  int64 l2 = -b - max(c - 1, 0LL) / 2;
  int64 u2 = -b + max(c - 1, 0LL) / 2;

  int64 c1 = u1 - l1 + 1;
  int64 c2 = u2 - l2 + 1;
  int64 ans = c1 + c2;
  int64 l3 = max(l1, l2);
  int64 u3 = min(u1, u2);
  if (l3 <= u3) {
    ans -= u3 - l3 + 1;
  }
  cout << ans << endl;
}


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

int main() {
    int N, S, D;
    cin >> N >> S >> D;
    vector<pair<int, int>> magic(N);
    bool a = false;
    for (int i = 0; i < N; i++) {
        cin >> magic.at(i).first;
        cin >> magic.at(i).second;
        if(magic.at(i).first < S && D < magic.at(i).second) {
            a = true;
        }
    }

    if (a == true) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

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

const int N = 1e5 + 5;
int n[N];

int main(){
    int a, b , c ,d;
    cin >> a >> b >> c>>d;
    cout << b -c;
}


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

#pragma GCC optimize("O3","unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("avx2")

#define sync ios_base::sync_with_stdio(0); cin.tie(0);
#define all(x) x.begin(),x.end()
#define unq(a) sort(all(a));a.resize(unique(all(a)) - a.begin())
#define ll long long
#define ld float
#define pb push_back
#define fi first
#define se second
#define endl '\n'
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rng(1);
using pii = pair<int , int>;

int inline max(const int x, const int y){return (x > y ? x : y);}
int inline min(const int x, const int y){return (x < y ? x : y);}
int inline abs(const int x){return (x < 0 ? -x : x);}

const int N = 2e5 + 5, mod = 1e9 + 7;

ll power(ll x, ll y){
  ll r = 1;
  while(y > 0){
    if (y & 1){
      r *= x; r %= mod;
    }
    y >>= 1;
    x *= x; x %= mod;
  }
  return r;
}

int main(){

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    sync

    int t = 1;
    //cin >> t;
    while(t--){
      int n;
      cin >> n;
      vector<ll> a(n);
      for (ll& x : a) cin >> x;
      ll cnt = 0;
      vector<ll> dp0(n + 1), dp1(n + 1), ways(n + 1);
      dp0[1] = dp1[1] = 1;
      ways[0] = 1; ways[1] = 2;
      for (int i = 2; i <= n; i++){
        dp0[i] = dp1[i - 1]; // minus
        dp1[i] = dp0[i - 1] + dp1[i - 1]; // plus
        dp0[i] %= mod; dp1[i] %= mod;
        ways[i] = (dp0[i] + dp1[i]) % mod;
      }
      cnt = (ways[n - 1] * a[0]) % mod;
      for (int i = 1; i < n; i++){
        int l = i - 1, r = n - i - 1;
        cnt += ((ways[l] * ways[r]) % mod * a[i]) % mod; cnt %= mod;
        //cout << a[i] << " -> " << ways[l] * ways[r] << endl;
        l--; r--;
        l = max(l , 0); r = max(r , 0);
        cnt += ((ways[l] * ways[r]) % mod * (mod - a[i]) % mod) % mod; cnt %= mod;
        //cout << -a[i] << " -> " << ways[l] * ways[r] << endl;
      }
      cout << cnt << endl;
    }
    cerr << "processor time: " << clock() / (double) CLOCKS_PER_SEC << "s    ";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
// 型
#define ll int64_t                  // ll -> int64_t
using graph = vector<vector<int>>;  // グラフ型
// for文
#define lp(i,n) for(int i=0;i<n;i++)      // 変数 i をおいて n 回繰り返し
#define lp_(i,n) for(int i=0;i<=n;i++)    // 条件に＝つき
#define lpp(i,n,m) for(int i=n;i<m;i++)   // 開始と終了を指定して繰り返し
#define lpp_(i,n,m) for(int i=n;i<=m;i++) // 開始と終了を指定，条件に＝つき
// vector定義
#define _GLIBCXX_DEBUG
#define vec(v,n) vector<int> v(n)       // int
#define vec_(v,n,m) vector<int> v(n,m)  // int 初期条件あり
#define vec64(v,n) vector<ll> v(n)      // int64_t
#define vec64_(v,n,m) vector<ll> v(n,m) // int64_t 初期条件あり
#define vecc(v,n) vector<char> v(n)     // char
#define vecs(v,n) vector<string> v(n)   // string
#define vece(v) vector<int> v;          // int 空
#define vecec(v) vector<char> v;        // char 空
#define vec2i(v,h,w) vector<vector<int>> v(h,vector<int>(w))    // 二次元配列 int
#define vec2c(v,h,w) vector<vector<char>> v(h,vector<char>(w))  // 二次元配列 char
// vector,string操作
#define all(v) v.begin(),v.end()
#define back(v) v.back()                         // 最後の要素
#define sum(v) accumulate(all(v),0)              // 総和
#define sort(v) sort(all(v))                     // ソート
#define reverse(v) reverse(all(v))               // 反転
#define lower(v,x) lower_bound(all(v),x)-v       // x<=a[i]となる最小のi / a[i]<xとなるiの個数
#define cou(v,n) count(all(v),n)               // n の出現回数を数える
#define pb(v,n) v.push_back(n)                   // 最後尾に n を追加
#define ins(v,i,n) v.insert(v.begin()+i,n)       // 場所を指定してv[i]に n を追加
#define del(v) v.pop_back()                      // 最後尾を削除
#define del0(v) v.erase(v.begin())               // 最初の要素v[0]を削除
#define del_(v,i) v.erase(v.begin()+i)           // 場所を指定してv[i]を削除
#define del__(v,i,j) v.erase(v.begin()+i,v.begin()+j+1)  // 範囲を指定してv[i]~v[j]を削除
#define sub(s,i,j) s.substr(i,j-i+1)             // 範囲を指定してs[i]~s[j]を取得【stringのみ】
// others
const ll MOD=998244353;
const ll INF=(1LL<<60);
#define under(n) cout<<fixed<<setprecision(n) // 小数点以下の桁数を指定
#define cout(n) cout<<n<<endl
#define mypair pair<int,int>

int main()
{
  ll ans=1;
  int h,w;
  cin>>h>>w;
  vec2c(a,h,w);
  lp(i,h)
  {
    lp(j,w)
      cin>>a[i][j];
  }
  for(int i=1;i<w;i++)
  {
    int flag=0;
    int px=0,py=i;
    for(;;)
    {
      if(a[px][py]=='R')
      {
        if(flag==0||flag==1)
          flag=1;
        else
        {
          ans=0;
          //goto EN;
        }
      }
      else if(a[px][py]=='B')
      {
        if(flag==0||flag==2)
          flag=2;
        else
        {
          ans=0;
          //goto EN;
        }
      }
      px++;
      py--;
      if(px>=h||py<0)
        break;
    }
    if(flag==0)
    {
      ans*=2;
      ans%=MOD;
    }
  }

  for(int i=1;i<h-1;i++)
  {
    int flag=0;
    int px=i,py=w-1;
    for(;;)
    {
      if(a[px][py]=='R')
      {
        if(flag==0||flag==1)
          flag=1;
        else
        {
          ans=0;
          //goto EN;
        }
      }
      else if(a[px][py]=='B')
      {
        if(flag==0||flag==2)
          flag=2;
        else
        {
          ans=0;
          //goto EN;
        }
      }
      px++;
      py--;
      if(px>=h||py<0)
        break;
    }
    if(flag==0)
    {
      ans*=2;
      ans%=MOD;
    }
  }
  if(a[0][0]=='.')
  {
    ans*=2;
    ans%=MOD;
  }
  if(a[h-1][w-1]=='.')
  {
    ans*=2;
    ans%=MOD;
  }
  cout(ans);
}


#include <bits/stdc++.h>

using namespace std;

#define  ll long long
#define ld long double
#define f first
#define s second

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

    ll s,p;
    cin >> s >> p;

    for(ll i=1; i*i<=p; i++)
    {
        ll x = i , y = p/i;
        if (x*y == p && x+y==s) return cout << "Yes" << '\n' , 0;
    }

    cout << "No\n";

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define INF ((1LL<<62)-(1LL<<31))
typedef long long ll;

int main()
{
    int n;
    cin >> n;
    vector<ll> c(n*n);
    rep(i,n*n) cin >> c[i];
    ll mi=INF,ni;
    rep(i,n) {
        if(mi>c[i*n]) {
            mi=c[i*n];
            ni=i*n;
        }
    }
    vector<ll> v;
    rep(i,n) {
        ll check=c[i*n]-mi;
        bool flag=true;
        rep(j,n) if(c[i*n+j]-c[ni+j]!=check) flag=false;
        //cout << check << endl;
        if(!flag) {
            cout << "No" << endl;
            return 0;
        }
        v.push_back(check);
    }
    cout << "Yes" << endl;
    rep(i,n) {
        if(i==0) cout << v[i];
        else cout << " " << v[i];
    }
    cout << endl;
    rep(i,n) {
        if(i==0) cout << c[ni];
        else cout << " " << c[ni+i];
    }
    cout << endl;
    return 0;
}


#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include <algorithm>
#include <iostream>
#include <bitset>
#include <vector>
#include <array>
using namespace std;
#define f(x,y,z) for(int x=y;x<=z;++x)
vector<int> v[200001];
int n, a, b, it;
array<int, 200001> jr, dlm, nmr;
bitset<200001> sdh;
void jrk(int x) {
    for(int &i:v[x]) if(!jr[i]) {
        jr[i] = jr[x]+1, jrk(i);
    }
}
void trn(int x) {
    sdh[x] = true;
    for(int &i:v[x]) if(!sdh[i]) {
        trn(i), dlm[x] = max(dlm[x], dlm[i]+1);
    }
}
void isi(int x) {
    sdh[x] = true, nmr[x] = a;
    vector<pair<int, int>> mn;
    for(int &i:v[x]) if(!sdh[i]) mn.push_back({dlm[i], i});
    sort(mn.begin(), mn.end());
    for(auto &i:mn) ++a, isi(i.second), ++a;
}
int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    cin >> n;
    f(i,2,n) {
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    jr[1] = a = 1, jrk(1);
    it = max_element(jr.begin()+1, jr.begin()+n+1)-jr.begin();
    trn(it), sdh.reset(), isi(it);
    f(i,1,n) cout << nmr[i] << ' ';
}

#include <iostream>

using namespace std;

const int N = 400'009;

int p[N];

int find(int x) {
  if (p[x] != x) {
    p[x] = find(p[x]);
  }
  return p[x];
}

int sz[N];
int cycle[N];

int main() {
#ifndef LOCAL
  cin.tie(0);
#endif
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < N; ++i) {
    p[i] = i;
    sz[i] = 1;
    cycle[i] = 0;
  }
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> y >> x;
    --x;
    --y;
    int px = find(x);
    int py = find(y);
    if (py != px) {
      p[py] = px;
      sz[px] += sz[py];
      if (cycle[py]) {
        cycle[px] = 1;
      }
    } else {
      cycle[px] = 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    if (find(i) == i) {
      ans += sz[i] - 1 + cycle[i];
    }
  }
  cout << ans << '\n';
}


#include<bits/stdc++.h>
using namespace std;
#define DONTSYNC ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL) //dont use stdio with iostream functions //input and output are out of order now!
#define TEST unsigned long long T; cin>>T; while(T--)  //loop over each testcase
#define endl "\n"
#define fori(a,start,end) for(int a=start;a<end;a++)
#define forl(a,start,end) for(long long a=start;a<end;a++)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
typedef long long     ll;
typedef long double   ld;
typedef pair<int,int> pii;
typedef pair<ll,ll>   pll;
typedef vector<int>   vi;
typedef vector<ll>    vl;
typedef vector<pii>   vii;
typedef vector<pll>   vll;
typedef vector<vi>    vvi;
typedef vector<vl>    vvl;
const double PI = acos(-1);

long long binpow(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

long long inverse(long long a,long long m){
    return binpow(a,m-2,m);
}

// modular
long long binomial_coefficient(long long n,long long r,long long m, vector<long long> &fact, vector<long long> &invfact) {
    if(r>n) return 0;
    return fact[n] * invfact[r]%m * invfact[n - r]%m;
}

// helper
void compute_fact(vector<long long> &fact, long long m){
    int n=fact.size();
    fact[0] = 1;
    for (int i = 1; i < n; i++) {
        fact[i] = fact[i - 1] * i % m;
    }
}
void compute_invfact(vector<long long> &invfact, long long m){
    int n=invfact.size();
    invfact[0] = 1;
    for (int i = 1; i < n; i++) {
        invfact[i] = invfact[i - 1] * inverse(i,m) % m;
    }
}
const ll mod=1e9+7;
void solve(){
    /* code */
    ll n,m,k,MX=2e6+5; cin>>n>>m>>k;
    vl fact(MX),invfact(MX); compute_fact(fact,mod); compute_invfact(invfact,mod);
    if(n>m+k){
        cout<<0<<endl;
        return;
    }
    ll res=mod+binomial_coefficient(m+n,n,mod,fact,invfact)-binomial_coefficient(m+n,m+k+1,mod,fact,invfact);
    cout<<res%mod<<endl;
}

int main()
{
    DONTSYNC;
    // TEST
    solve();
    return 0;
}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>

#line 1 "lib/combination.hpp"

#line 1 "lib/modint.hpp"

#include <iostream>

// Modint
struct Mint {
    static const long long mod = (long long)1e9 + 7;
    long long val;

    Mint() { val = 0; }
    Mint(long long a) {
        val = a;
        verify_value();
    }

    void verify_value() {
        if (val >= mod) val %= mod;
        if (val < 0) val %= mod, val += mod;
    }

    Mint pow(long long p) const {
        Mint cur = Mint(val), ret = 1;
        while (p > 0) {
            if (p & 1) ret *= cur;
            cur *= cur;
            p >>= 1LL;
        }
        return ret;
    }
    Mint inv() const {
        if (val == 0)
            std::cerr << "WARNING: inv() is called with 0." << std::endl;
        return pow(mod - 2);
    }

    Mint operator+() const { return *this; }
    Mint operator-() const { return Mint(mod - val); }

    Mint operator+=(const Mint &a) {
        val += a.val;
        if (val >= mod) val -= mod;
        return Mint(val);
    }
    Mint operator*=(const Mint &a) {
        val *= a.val;
        if (val >= mod) val %= mod;
        return Mint(val);
    }
    Mint operator-=(const Mint &a) { return *this += -a; }
    Mint operator/=(const Mint &a) { return *this *= a.inv(); }

    Mint operator++() { return *this += Mint(1); }
    Mint operator--() { return *this -= Mint(1); }
    Mint operator++(int) {
        Mint ret = *this;
        ++(*this);
        return ret;
    }
    Mint operator--(int) {
        Mint ret = *this;
        --(*this);
        return ret;
    }

    operator long long() const { return val; }
};

Mint operator+(const Mint &a, const Mint &b) {
    long long ret = a.val + b.val;
    if (ret >= Mint::mod) ret -= Mint::mod;
    return Mint(ret);
}
Mint operator*(const Mint &a, const Mint &b) {
    long long ret = a.val * b.val;
    if (ret >= Mint::mod) ret %= Mint::mod;
    return Mint(ret);
}
Mint operator-(const Mint &a, const Mint &b) { return a + (-b); }
Mint operator/(const Mint &a, const Mint &b) { return a * b.inv(); }

std::ostream &operator<<(std::ostream &out, const Mint &a) {
    return out << a.val;
}
std::istream &operator>>(std::istream &in, Mint &a) {
    in >> a.val;
    a.verify_value();
    return in;
}

Mint pow(Mint a, long long b) { return a.pow(b); }

#line 5 "lib/combination.hpp"
#include <vector>

constexpr int MAX_N = 2000003;
std::vector<Mint> fact(MAX_N), inv(MAX_N);

void init_fact() {
    fact[0] = inv[0] = 1;
    for (long long i = 1; i < MAX_N; i++) {
        fact[i] = fact[i - 1] * Mint(i);
        inv[i] = fact[i].inv();
    }
}

// aCb
Mint C(int a, int b) {
    if (a < 0 || b < 0 || a < b) return 0;
    Mint res = fact[a];
    res *= inv[b];
    res *= inv[a - b];
    return res;
}

// aPb
Mint P(int a, int b) {
    if (a < 0 || a < b) return 0;
    return fact[a] * inv[a - b];
}

// aHb
Mint H(int a, int b) {
    if (b == 0) return 1;
    return C(a + b - 1, b);
}

int main() {
    int n, m, k;
    std::cin >> n >> m >> k;
    if (n > m + k) {
        std::cout << 0 << std::endl;
        return 0;
    }
    init_fact();
    std::cout << C(n + m, n) - C(m + n, m + k + 1) << std::endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int N=2e5+5;
const int mod=1e9+7;

int ans[N],parent[N];
vector<pair<int,int>>adj[N];
pair<pair<int,int>,int>edges[N];

int FindParent(int x)
{
    if(parent[x] == x)return x;
    return parent[x]=FindParent(parent[x]);
}

void DFS(int cur,int par)
{
    int x,y;
    for(auto it : adj[cur])
    {
        x=it.first;
        y=it.second;
        if(!(x ^ par))continue;
        if(ans[cur] == y)
        {
            if(y == 1)ans[x]=2;
            else ans[x]=1;
        }
        else ans[x]=y;
        DFS(x,cur);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int i,m,n,x,y,z,px,py;
    cin >> n >> m;
    for(i=1;i<=m;i++)
    {
        cin >> x >> y >> z;
        edges[i].first.first=x;
        edges[i].first.second=y;
        edges[i].second=z;
    }
    for(i=1;i<=n;i++)parent[i]=i;
    for(i=1;i<=m;i++)
    {
        x=edges[i].first.first;
        y=edges[i].first.second;
        z=edges[i].second;
        px=FindParent(x);
        py=FindParent(y);
        if(px != py)
        {
            parent[py]=px;
            adj[x].emplace_back(y,z);
            adj[y].emplace_back(x,z);
        }
    }
    ans[1]=1;
    DFS(1,1);
    for(i=1;i<=n;i++)cout << ans[i] << '\n';
    return 0;
}

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

#define         pb         push_back
#define         sf(x)      scanf("%d",&x)
#define         sfl(x)     scanf("%lld",&x)
#define         pf(x)      printf("%d\n",x)
#define         pfl(x)     printf("%lld\n",x)
#define         endl       '\n'
#define         pii        pair<int,int>
#define         mapii      map<int,int>
#define         mapll      map<ll,ll>
#define         mapci      map<char,int>
#define         mapcl      map<char,ll>
#define         mapsi      map<string,int>
#define         mapsl      map<string,ll>
#define         pll        pair<ll,ll>
#define         vi         vector<int>
#define         vl         vector<ll>
#define         vd         vector<double,double>
#define         all(c)     c.begin(),c.end()
#define         F          first
#define         S          second

mapii row,col;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int r,c,i,j,k,l,m,n,h,w;

    cin >> h >> w >> n >> m;

    char s[h+2][w+2];
    for(i=1; i<=h; i++)
    {
        for(j=1; j<=w; j++)
        {
            s[i][j] = '*';
        }
    }

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

        pt.pb({a,b});
    }
    for(i=0; i<m; i++)
    {
        cin >> a >> b;

        s[a][b] = '#';
    }
    int no = 0;

    for(auto x : pt)
    {
        a = x.F;
        b = x.S;
        i = a,j = b;
        while(i)
        {
            if(s[i][j] == '#')break;
            s[i][j] = '1';
            i--;
        }
        i = a,j = b;
        while(i<=h)
        {
            if(s[i][j] == '#')break;

            s[i][j] = '1';
            i++;
        }
        i = a,j = b;
        while(j<=w)
        {
            if(s[i][j] == '#')break;

            s[i][j] = '1';
            j++;
        }
        i = a,j = b;
        while(j)
        {
            if(s[i][j] == '#')break;

            s[i][j] = '1';
            j--;
        }
    }

    for(i=1; i<=h; i++)
    {
        for(j=1; j<=w; j++)
        {
            if(s[i][j]!='1')no++;
        }
    }

    cout << (h*w)-no << endl;
}


#include<bits/stdc++.h>
using namespace std;
template<typename T>inline T read(){
	T x=0,f=0;char c=getchar();
	while(!isdigit(c)) f=c=='-',c=getchar();
	while(isdigit(c)) x=x*10+c-48,c=getchar();
	return f?-x:x;
}
#define int long long
namespace run{
	const int N=1e5+9;
	int n,a[N],b[N],ans;
	priority_queue<int> pq[2];
	int main(){
		n=read<int>();
		for(int i=1;i<=n;i++) ans+=(a[i]=read<int>());
		for(int i=1;i<=n;i++) b[i]=read<int>();
		for(int i=1;i<=n;i++) pq[i&1].push(b[i]-a[i]);
		while(!pq[0].empty() && !pq[1].empty() && pq[0].top()+pq[1].top()>0){
			ans+=pq[0].top()+pq[1].top();
			pq[0].pop(),pq[1].pop();
		}
		printf("%lld\n",ans);
		return 0;
	}
}
#undef int
int main(){
#ifdef my
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	return run::main();
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#define rep(i,l,r) for(int i=(l);i<=(r);++i)
#define per(i,r,l) for(int i=(r);i>=(l);--i)
using namespace std;
typedef long long ll;
const int N=1e5+10;
int n,a[N],b[N],c[N],x;ll ans;
int main(){
	scanf("%d",&n);
	rep(i,1,n) scanf("%d",a+i),ans+=a[i];
	rep(i,1,n) scanf("%d",&x),i&1?b[i+1>>1]=x-a[i]:c[i>>1]=x-a[i];
	sort(b+1,b+(n>>1)+1);sort(c+1,c+(n>>1)+1);
	rep(i,1,n>>1) if(b[i]+c[i]>0) ans+=b[i]+c[i];
	printf("%lld\n",ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

int main(){
    int N;
    cin >> N;
    if (N%2 == 0){
        cout << "White" << endl;
    }
    else cout << "Black" << endl;
}

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

int main() {

  int64_t n;
  cin>>n;

  if(n%2==0)
    cout<<"White"<<endl;
  else
    cout<<"Black"<<endl;

  return 0;
}