#include<iostream>
using namespace std;

int main()
{
  int x;
  cin>>x;
  cout<<100-x%100;

return 0;
}

#include<bits/stdc++.h>

#define LL long long
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()

const double eps=1e-7,PI=3.1415926;
const int N=1e6+10;

using namespace std;

int n,q,m,k,x,y,a[N],mx=-1,mn=1e9,sum;
string s,s1,s2;
map < int , int > mp;
vector < int > vec;
set < int > st;
bool ok(int x){
    int ret=0;
    if (x%2==0)ret++;
    if (x%3==0)ret++;
    if (x%5==0)ret++;
    return(x%661>0&&ret>=2);
}

int main(){
    cin>>n;
    int cnt=1;
    for (int i=0;i<n-2;i++){
        while (!ok(cnt))cnt++;
        cout<<cnt<<" ";
        cnt++;
    }
    cout<<2*5*661<<" "<<3*5*661<<endl;
    return 0;
}


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

#define ll              long long int
#define scan(any)       for(auto &i:any) cin>>i;
#define print(any)      for(auto i:any) cout<<i<<" ";
#define endl            '\n'
#define pb              push_back
#define vll             vector<ll>
#define f(i,x,y)        for(i=x;i<y;i++)
#define INF             LLONG_MAX
#define s(x)            sort(x.begin(),x.end())
#define all(v)          v.begin(),v.end()
#define p2(n,x)         cout << fixed << setprecision(x) <<n<<endl;
#define pll             pair<ll,ll>
#define ff              first
#define ss              second
#define blt(x)          __builtin_popcount(x)

void solve()
{
    ll i,j,b,s,p;
    cin>>s>>p;
    for(i=1;i<=(int)sqrt(p);i++)
    {
    	if(p%i==0)
    	{
    		if(i+(p/i)==s)
    		{
    			cout<<"Yes";
    			return ;
    		}
    	}
    }
    cout<<"No\n";
}

int main()
{
    #ifdef Sudarshan
        freopen("F:/Programming/input.txt", "r", stdin);
        freopen("F:/Programming/output.txt", "w", stdout);
    #endif

    ios::sync_with_stdio(0);
    cin.tie(0);

    ll t = 1;
    while(t--) {
        solve();
    }
    return 0;
}

#include <bits/stdc++.h>
typedef long long ll;
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
using namespace std;

//const ll mod =  998244353;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // long longの1次元の型に vll という別名をつける
using vvll = vector<vll>; // long longの2次元の型に vvll という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pll という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main() {
   ll s,p;
   cin>>s>>p;

   bool ans=false;
   for(ll i=1;i*i<=p;i++){
       if(p%i==0){

           ll j=p/i;

           if(i+j==s)ans=true;
       }
   }
   if(ans)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

int main() {
    ll t;
    cin >> t;

    rep(loop, t) {
        ll L, R;
        cin >> L >> R;
        if(R - 2*L < 0) {
            out(0);
        }
        else {
            out((R - 2*L + 1)*(R - 2*L + 2)/2);
        }
    }

    re0;
}

#include <bits/stdc++.h>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define ll long long
using namespace std;
ll int mod=998244353;//1e9+7;

struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return hash<int>()(((int)x.first)^(((int)x.second)));
  }
};

struct HASH1{
  size_t operator()(const int&x)const{
    return hash<int>()((x));
  }
};

ll int mul(ll int x, ll int y)
{
    return (x * 1ll * y) % mod;
}

ll int add(ll int x,ll int y)
{
    x += y;
    while(x >= mod) x -= mod;
    while(x < 0) x += mod;
    return x;
}

 int main() {
    IOS;
    int t;
    cin>>t;
    while(t--)
    {
       ll int l,r;
       cin>>l>>r;
       ll int x=r-l;
       if(x==0 && l!=0)
       {
       cout<<0<<endl;
        continue;
       }
       if(x<l)
       {
           cout<<0<<endl;
          continue;
       }
       x=x-l+1;
       x=(x*(x+1))/2;
       cout<<x<<endl;
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#pragma GCC optimize ("Ofast")
#pragma GCC optimization ("unroll-loops, no-stack-protector")
#pragma GCC target ("avx")
#pragma GCC target ("avx2")
#pragma GCC target ("fma")
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI acos(-1)
#define ordered_set tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update>
#pragma 03
using namespace std;
using namespace __gnu_pbds;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll dp[100005];
vll children[100005];
ll subtree[100005];
void dfs(ll u){
	subtree[u] = 1;
	for (auto v : children[u]){
		dfs(v); subtree[u] += subtree[v];
	}
	ll sum_pos_even = 0, sum_neg_even = 0;
	vll odd;
	dp[u] = 1;
	for (auto v : children[u]){
		if (subtree[v] & 1) odd.eb(dp[v]);
		else if (dp[v] < 0) sum_pos_even -= dp[v];
		else sum_neg_even += dp[v];
	}
	dp[u] -= sum_pos_even;
	if (odd.size() & 1) dp[u] -= sum_neg_even;
	else dp[u] += sum_neg_even;
	sort(odd.begin(), odd.end());
	for (ll i = 0; i < (ll) odd.size(); i++){
		if (i & 1) dp[u] -= odd[i];
		else dp[u] += odd[i];
	}
}
int main(){
	fastio;
	ll n; cin >> n;
	for (ll i = 2; i <= n; i++){
		ll p; cin >> p;
		children[p].eb(i);
	}
	dfs(1);
	cout << (n + dp[1]) / 2 << "\n";
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef map<ll, ll> ml;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {return (a % b + b) % b;}
ll quo(ll a, ll b) {return (a - mod(a, b)) / b;}
template <typename T, typename U> bool chmin(T &a, const U b) {if(a > b) {a = b; return 1;} return 0;}
template <typename T, typename U> bool chmax(T &a, const U b) {if(a < b) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 2e5;
const ld eps = 1e-9;
const char newl = '\n';

struct mint{
  ll val;
  mint() {}
  mint(ll x) {val = mod(x, MOD);}
  mint operator-() {return mint(-this->val);}
  bool operator==(mint a) {return this->val == a.val;}
  bool operator<(mint a) {return this->val < a.val;}
  bool operator!=(mint a) {return this->val != a.val;}
  mint operator+(mint a) {return mint(this->val + a.val);}
  mint operator-(mint a) {return mint(this->val - a.val);}
  mint operator*(mint a) {return mint(this->val * a.val);}
  mint operator/(mint a) {return mint(this->val * a.inv().val);}
  mint &operator+=(mint a) {return *this = *this + a;}
  mint &operator-=(mint a) {return *this = *this - a;}
  mint &operator*=(mint a) {return *this = *this * a;}
  mint &operator/=(mint a) {return *this = *this / a;}
  friend istream &operator>>(istream &is, mint &m) {
    is >> m.val;
    return is;
  }
  friend ostream &operator<<(ostream &os, mint &m) {
    os << m.val;
    return os;
  }
  mint pow(ll n) {
    if(n == 0) return 1;
    if(n & 1) return pow(n-1) * *this;
    mint ret = pow(n/2);
    return ret * ret;
  }
  vector<mint> powv(ll n) {
    vector<mint> vec(n+1, 1);
    rep2(i, 1, n) vec[i] = vec[i-1] * *this;
    return vec;
  }
  mint inv() {return pow(MOD-2);}
  vector<mint> invv(ll n) {
    vector<mint> vec(n+1, 1);
    rep2(i, 2, n) vec[i] = -vec[MOD%i] * (MOD/i);
    return vec;
  }
};

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

  ll n, p;
  cin >> n >> p;
  mint ans = mint(p-1)*(mint(p-2).pow(n-1));
  cout << ans << newl;
  return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
#include <random>
#include <cassert>
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define REPE(i, n) for (int (i)=0; (i) <= (n); (i)++)
#define CONTAINS_MAP(m, a) ((m).find((a)) != m.end())
#define CONTAINS_SET(m, a) ((m).find((a)) != m.end())
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; exit(0); }
void Yes() { cout << "Yes" << endl; exit(0); }
void No() { cout << "No" << endl; exit(0); }

signed main()
{
	int N;
	cin >> N;

	double ans = 0;
	for (int i = 1; i <= N; i++)
	{
		ans += N * (1 / (double)i);
	}
	cout << fixed << setprecision(10);
	cout << ans - 1 << endl;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long double ans = 0;
  for (int i = n - 1; i >= 1; i--) {
    ans += 1 / (long double) i;
  }
  ans *= n;
  cout << fixed << setprecision(17) << ans << '\n';
  return 0;
}

/* stuff you should look for, credit: Benq

* int overflow, array bounds
* special cases (n=1? || n=0? ...)
* do smth instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH

*/


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

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}

#define int long long
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define precise(x) fixed << setprecision(x)

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;

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

    return res;
}

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

   int ps = 5;
   int i = 1;

   while(ps <= n)
   {
      int v = n - ps;
      int cnt = 0;

      while(v % 3 == 0 && (v > 1))
      {
          v/=3;
          cnt++;
      }

      if(v == 1 && cnt > 0)
      {
          cout << cnt << ' ' << i;
          exit(0);
      }

      i++;

      if((n/5) < ps) break;

      ps*=5;

   }

   cout << -1;

}

signed main()
{
    fast;

    int t = 1;

//    cin >> t;

    while(t--)

    solve();
}

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

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define LL long long
#define ULL unsigned long long
#define LB lower_bound
#define MOD1 1000000007
#define MOD2 1000000009
#define int LL
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
const int maxn = 1e5 + 1;
string s;

bool solve()
{
    if (s.size() < 3)
    {
        int n = stoll(s);
        if (n % 8 == 0)
            return 1;
        string temp(s);

        reverse(temp.begin(), temp.end());
        n = stoll(temp);
        if (n % 8 == 0)
            return 1;

        return 0;
    }

    unordered_map<int, int> mp;
    for (auto &i : s)
    {
        i -= '0';
        mp[i]++;
    }

    for (int i = 104; i < 1000; i += 8)
    {
      int orig = i;
        int freq[10] = { 0 };
        freq[orig % 10]++;
        orig = orig / 10;
        freq[orig % 10]++;
        orig = orig / 10;
        freq[orig % 10]++;

        orig = i;
        if (freq[orig % 10] > mp[orig % 10])
            continue;
        orig = orig / 10;

        if (freq[orig % 10] > mp[orig % 10])
            continue;
        orig = orig / 10;

        if (freq[orig % 10] > mp[orig % 10])
            continue;

        return true;
    }
    return 0;
}

signed main()
{
    int t = 1;
    // cin >> t;

    while (t--)
    {
        cin >> s;
        if (solve())
            cout << "Yes\n";
        else
            cout << "No\n";
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF ((1<<30)-1)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()

struct TrieNode{
	int n = 0;
	long long sum = 0;
	TrieNode* l = nullptr, * r = nullptr;
};

class Trie {
public:
	Trie() { root = new TrieNode(); }

	void insert(int x) {
		TrieNode* t = root;
		for (int i = 30; i >= 0; i--) {
			t->n++;
			t->sum += x;
			if (x >> i &1) {
				if (t->r == nullptr) t->r = new TrieNode;
				t = t->r;
			}
			else {
				if (t->l == nullptr) t->l = new TrieNode;
				t = t->l;
			}
		}
		t->n++;
		t->sum += x;
	}

	void erase(int x) {
		TrieNode* t = root;
		for (int i = 30; i >= 0; i--) {
			t->n--;
			t->sum -= x;
			if (x >> i & 1) {
				t = t->r;
			}
			else {
				t = t->l;
			}
		}
		t->n--;
		t->sum -= x;
	}

	pair<int, long long> query(int x) const{
		pair<int, long long > ret(0, 0);
		TrieNode* t = root;
		for (int i = 30; i >= 0; i--) {
			if (t == nullptr)break;
			if (x >> i & 1) {
				if (t->l) {
					ret.first += t->l->n;
					ret.second += t->l->sum;
				}
				t = t->r;
			}
			else {
				t = t->l;
			}
		}
		return ret;
	}
private:
	TrieNode* root;
};

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

	int n, m, q;
	cin >> n >> m >> q;

	vector<int> a(n, 0), b(m, 0);

	Trie ta, tb;
	rep(i, n) ta.insert(0);
	rep(i, m)tb.insert(0);

	long long ans = 0;
	rep(_, q) {
		int t, x, y;
		cin >> t >> x >> y;
		x--;

		if (t == 1) {
			auto p = tb.query(a[x]);
			ans -= (long long)p.first * a[x];
			ans += p.second;

			p = tb.query(y);
			ans += (long long)p.first * y;
			ans -= p.second;

			ta.erase(a[x]);
			ta.insert(y);
			a[x] = y;
		}
		else {
			auto p = ta.query(b[x]);
			ans -= (long long)p.first * b[x];
			ans += p.second;

			p = ta.query(y);
			ans += (long long)p.first * y;
			ans -= p.second;

			tb.erase(b[x]);
			tb.insert(y);
			b[x] = y;
		}
		cout << ans << endl;
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxN = 4e5 + 10;
ll N[2], Q, a[2][maxN];
ll tot, T[maxN], x[maxN], y[maxN], c[maxN], sum[2][maxN], d[2][maxN];
int read(); void write(ll);
int lowbit(int x){return x & -x;};
void update1(int x, int v, int t){
	for(; x <= tot; x += lowbit(x)) d[t][x] += v;
}
void update2(int x, int v, int t){
	for(; x <= tot; x += lowbit(x)) sum[t][x] += v;
}
ll query1(int x, int t){
	ll ans = 0;
	for(; x; x -= lowbit(x)) ans += d[t][x];
	return ans;
}
ll query2(int x, int t){
	ll ans = 0;
	for(; x; x -= lowbit(x)) ans += sum[t][x];
	return ans;
}
int main(){
	N[0] = read(); N[1] = read(); Q = read();
	for(int i = 1; i <= Q; i++) T[i] = read() - 1, x[i] = read(), c[i] = y[i] = read();
	sort(c + 1, c + Q + 1);
	tot = unique(c + 1, c + Q + 1) - c;
	T[0] = 0; for(int i = 1; i <= N[0]; i++) update1(1, 1, 0);
	T[0] = 1; for(int i = 1; i <= N[1]; i++) update1(1, 1, 1);
	ll ans = 0;
	for(int i = 1; i <= Q; i++){
		int _new = lower_bound(c, c + tot, y[i]) - c;
		int _old = a[T[i]][x[i]] + 1; a[T[i]][x[i]] = _new++;
		int t = T[i] ^ 1;
		ans += query2(_old, t) - query1(_old, t) * c[_old - 1];
		ll x = query1(_new, t), y = query2(_new, t);
		ans += x * c[_new - 1] - y;
		write(ans); puts("");
		update1(_old, -1, T[i]); update1(_new, 1, T[i]);
		update2(_old, -c[_old - 1], T[i]); update2(_new, c[_new - 1], T[i]);
	}
	return 0;
}
int read(){
	int s = 0; char ch = getchar();
	while(!isdigit(ch)) ch = getchar();
	while(isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
	return s;
}
void write(ll x){
	if(x < 0) x = -x, putchar('-');
	if(x > 9) write(x / 10);
	putchar(x % 10 ^ 48);
}


#include <bits/stdc++.h>
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F(w,x,y) for(ll w=x; w<y; w++)
#define endl "\n"
#define mod 1000000007
#define INF 1000000000
typedef long long ll;
typedef long double ld;
using namespace std;

void play()
{
    ll a,b,c;
    cin>>a>>b>>c;
    if(a*a+b*b<c*c)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        play();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007
#define mod2 998244353
void fast(){
  ios_base::sync_with_stdio(false);cin.tie(NULL);
}
long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}

int main() {
   fast();
   string s1,s2,s3;
   cin>>s1>>s2>>s3;
   set<char> s;
   for(int i=0;i<s1.length();i++){
    s.insert(s1[i]);
   }
   for(int i=0;i<s2.length();i++){
    s.insert(s2[i]);
   }
   for(int i=0;i<s3.length();i++){
    s.insert(s3[i]);
   }
   if(s.size()>10){
    cout<<"UNSOLVABLE"<<"\n";
    return 0;
   }
   vector<ll int> v;
   for(int i=0;i<10;i++){
    v.pb((ll)i);
   }
   vector<char> fin;
   for(char b:s){
    fin.pb(b);
   }
   map<char,ll int> mt;
   reverse(s1.begin(),s1.end());
   reverse(s2.begin(),s2.end());
   reverse(s3.begin(),s3.end());
   do{
     for(int i=0;i<fin.size();i++){
      mt[fin[i]]=v[i];
     }
     ll int num1=0;
     ll int num2=0;
     ll int num3=0;
     int x=s1.length()-1;
     int y=s2.length()-1;
     int z=s3.length()-1;
     if(mt[s1[x]]==0 || mt[s2[y]]==0 || mt[s3[z]]==0){
     	;
     }else{
     for(int i=0;i<s1.size();i++){
       num1+=(mt[s1[i]])*binpow((ll)(10),(ll)i);
     }
     for(int i=0;i<s2.size();i++){
       num2+=(mt[s2[i]])*binpow((ll)(10),(ll)i);
     }
     for(int i=0;i<s3.size();i++){
       num3+=(mt[s3[i]])*binpow((ll)(10),(ll)i);
     }
     if(num1+num2==num3){
      cout<<num1<<"\n";
      cout<<num2<<"\n";
      cout<<num3<<"\n";
      return 0;
     }
     }

   }while(next_permutation(v.begin(),v.end()));
   cout<<"UNSOLVABLE"<<"\n";

}


#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

//mod演算ライブラリ
//mod=1000000007

LL add(LL a,LL b){
  return (a+b)%mod;
}

LL sub(LL a,LL b){
  return (a+mod-b)%mod;
}

LL mul(LL a,LL b){
  return ((a % mod) * (b % mod)) % mod;
}

LL power(LL x,LL y){//繰り返し二乗法 単品利用可
  if(y==0)return 1;
  else if(y==1)return x%mod;
  else if(y%2==0){
    LL tmp=power(x, y/2) % mod;
    return tmp*tmp%mod;
  }else {
    LL tmp=power(x, y/2) % mod;
    return ((tmp*tmp)%mod)*x%mod;
  }
}

LL dvs(LL a,LL b){
  return mul(a,power(b,mod-2));
}

const int SIZE_mod=200005;
int invfact[SIZE_mod];
int fact[SIZE_mod];

void factset(int a){//aまでの階乗%mod表を作成
  fact[0]=1;
  FORQ(i,1,a){
    fact[i]=mul(fact[i-1],i);
  }
}

void cmbset(int a){//1~aまでの階乗と階乗数の逆元のmod(mod)を用意 O(a)
  factset(a);
  invfact[a]=power(fact[a],mod-2);
  invfact[0]=1;
  FORD(i,a,1){
    invfact[i]=mul(invfact[i+1],i+1);
  }

}

LL cmb(int n,int r){//nCr%mod  (cmbset後に使用)
  if(n<r||r<0||n<0)return 0;
  return mul(fact[n],mul(invfact[r],invfact[n-r]));
}

LL prm(int n,int r){//nPr%mod
    return mul(cmb(n,r),fact[n]);
}

LL homo(int n,int r){//nHr%mod
  return cmb(n+r-1,r);
}

int main(){
	int tt;
    cin>>tt;
    FOR(ti,0,tt){
        LL n,a,b;
        cin>>n>>a>>b;
        if(b>a)swap(a,b);
        LL all=mul(mul(n-a+1,n-a+1),mul(n-b+1,n-b+1));
        LL ta=n-a+1,tb=n-b+1;
        LL tt1=max(n-a-b+1,0LL);
        LL tt2=sub(mul(ta,tb),mul((tt1+1),tt1));
        LL rate=dvs(tt2,mul(ta,tb));
        LL t=mul(all,mul(rate,rate));
        cerr<<tt1<<" "<<tt2<<" "<<rate<<" "<<t<<endl;
        cout<<sub(all,t)<<endl;
    }
}

#include<bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }; } fast_ios_;
#define Local
#ifdef Local
  #define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
  void err() { std::cout << std::endl; }
  template<typename T, typename...Args>
  void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
  template <template<typename...> class T, typename t, typename... A>
  void err(const T <t> &arg, const A&... args) {
  for (auto &v : arg) std::cout << v << ' '; err(args...); }
#else
  #define dbg(...)
#endif
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pint;
typedef pair<ll,ll> plint;
const int mod = 1000000007;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

const int N = 2e5 + 10;

int n;

/*
	gcd(a[i], a[j]) > 1

	2 * 3 4 * 5 6 * 5  3 * 5

	2 * 5   /2 * 3 / 4 * 3 / .... /     3 * 5

	2 * 5 /  2 * 3  / 3 * 5 /

	/ 2 * 3 * 5

*/

int main()
{
	cin >> n;
	vector<int> v;
	v.pb(6), v.pb(10), v.pb(15);

	for (int i = 2; i * 6 <= 10000; i++) {
		if ((int)v.size() < n) v.pb(i * 6);
	}

	for (int i = 2; i * 10 <= 10000; i++) {
		if (i % 3 != 0 && (int)v.size() < n) v.pb(i * 10);
	}

	for (int i = 2; i * 15 <= 10000; i++) {
		if (i % 2 != 0 && i % 3 != 0 && (int)v.size() < n) v.pb(i * 15);
	}

	for (auto vi : v) cout << vi << ' ';

    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<ctime>
#include<map>
#define ll long long
#define MAXN 200005
#define uns unsigned
#define INF 0x3f3f3f3f
#define lowbit(x) ((x)&(-(x)))
#define MOD 998244353ll
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;
}
int n,a[MAXN],b[MAXN],m,st[MAXN];
map<int,int>mp;
map<int,int>::iterator it;
queue<int>s[MAXN<<1];
int f[MAXN];
inline void add(int x){
	for(;x<=n;x+=lowbit(x))f[x]++;
}
inline int sum(int x){
	int res=0;
	for(;x>0;x-=lowbit(x))res+=f[x];
	return res;
}
int main()
{
	n=read();
	for(int i=1;i<=n;i++)a[i]=read()+i,mp[a[i]]++;
	for(int i=1;i<=n;i++)b[i]=read()+i,mp[b[i]]++;
	for(it=mp.begin();it!=mp.end();it++)it->second=++m;
	for(int i=1;i<=n;i++)a[i]=mp[a[i]],b[i]=mp[b[i]];
	for(int i=1;i<=n;i++)s[b[i]].push(i);
//	for(int i=1;i<=n;i++)printf("%d ",a[i]);putchar('\n');
//	for(int i=1;i<=n;i++)printf("%d ",b[i]);putchar('\n');
	bool ok=1;
	for(int i=1;i<=n;i++){
		if(s[a[i]].empty()){ok=0;break;}
		st[i]=s[a[i]].front(),s[a[i]].pop();
	}
	if(!ok)printf("-1\n");
	else{
		ll ans=0;
//		for(int i=1;i<=n;i++)printf("%d ",st[i]);putchar('\n');
		for(int i=n;i>0;i--)ans+=sum(st[i]),add(st[i]);
		printf("%lld\n",ans);
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define BIG 200005

struct Data{
    double x;
    double y;

    bool operator<(const Data& right) const{
        return x < right.x;
    }
};

struct Dis{
    double dis;
    int i;
    int j;

    bool operator<(const Dis& right) const{
        return dis < right.dis;
    }
};

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]); // 返す値は代入される値。par[x]にルートを代入することで、次回以降、ルートへのアクセスの計算量を1にする。
    }

    bool merge(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return false; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        return true;

    }

    bool issame(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        return root(x) == root(y);
    }
};

int main() {
    int N;
    cin >> N;
    vector<Data> al;
    for(int i=0;i<N;i++){
        Data d;
        cin >> d.x >> d.y;
        al.push_back(d);
    }
    vector<Dis> disl; // i,jの距離. N, N+1はy=-100, 100
    for(int i=0;i<N;i++){
        Data data = al[i];
        for(int j=i+1;j<N;j++){
            double dx = data.x - al[j].x;
            double dy = data.y - al[j].y;
            Dis di{sqrt(dx*dx+dy*dy), i, j};
            disl.push_back(di);
        }
        Dis d{data.y+100, i, N};
        Dis d2{100-data.y, i, N+1};
        disl.push_back(d);
        disl.push_back(d2);
    }
    sort(disl.begin(), disl.end());
    UnionFind group(N+2);
    for(int i=0;i<disl.size();i++){
        // i, jを同じグループにする
        Dis d = disl[i];
        group.merge(d.i, d.j);
        if(group.issame(N, N+1)){
            cout << setprecision(10) <<d.dis / 2.0 << endl;
            return 0;
        }
    }

    return 0;
}


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

#define ll long long int
#define absdiff(a,b) (a>b)?a-b:b-a
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define fast  ios_base::sync_with_stdio(false);cin.tie(0);
#define MOD 1000000007
#define ll_MAX 19223372036859
#define endl "\n"
ll fast_expo(ll x,ll p){
  if(p==0) return 1;
  else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;}
  else return (x*(fast_expo(x,p-1))%MOD)%MOD;}

ll dp[1005][1005], n, m, arr1[1005], arr2[1005];
vector<ll> AdjL[1005];

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

  ll t_c; t_c = 1;
  // cin >> t_c;

  for(ll t_i = 0; t_i < t_c; ++t_i){
    ll n, m; cin >> n >> m;
    ll a[n + 1], b[m + 1];
    for(ll i = 1; i <= n; ++i)
      cin >> a[i];
    for(ll i = 1; i <= m; ++i)
      cin >> b[i];

    ll dp[n + 1][m + 1];
    for(ll j = 0; j <= m; ++j){
      dp[0][j] = j;
    }

    for(ll i = 1; i <= n; ++i){
      dp[i][0] = i;
      for(ll j = 1; j <= m; ++j){
        if(a[i] == b[j]) dp[i][j] = dp[i - 1][j - 1];
        else dp[i][j] = min({dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + 1});
      }
    }

    cout << dp[n][m];
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MOD = 1000000007;
const int MAX32 = 2147483647;
const long long MAX64 = 9223372036854775807;
const double PI = 3.14159265358979323846;

long long a[200], n, flag = -1, zeroflag;
string b[200], c;

void dfs(long long num, string s, long long sum) {
  if (num >= n) {
    if (b[sum] == "") {
      b[sum] = s;
    } else {
      flag = sum;
      c = s;
    }
  } else if (num == n - 1 && !zeroflag) {
    s += '1';
    dfs(num + 1, s, (sum + a[num]) % 200);
    zeroflag = 1;
  } else if (flag == -1) {
    s += '0';
    dfs(num + 1, s, sum);
    s[num] = '1';
    dfs(num + 1, s, (sum + a[num]) % 200);
  }
}

int main() {
  long long x = 0, y = 0;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] %= 200;
  }
  dfs(0, s, 0);
  if (flag == -1) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    for (int i = 0; i < n; i++) {
      x += (b[flag][i] == '1');
      y += (c[i] == '1');
    }
    cout << x;
    for (int i = 0; i < n; i++) {
      if (b[flag][i] == '1') {
        cout << " " << i + 1;
      }
    }
    cout << endl;
    cout << y;
    for (int i = 0; i < n; i++) {
      if (c[i] == '1') {
        cout << " " << i + 1;
      }
    }
    cout << endl;
  }
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
#include<set>
#include<complex>
#include<numeric>
#include<functional>
#include<unordered_map>
#include<unordered_set>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
    for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
    for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
    if(vec_n==-1)vec_n=vec_s.size();
    for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
    if(vec_n==-1)vec_n=vec_s.size();
    for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

namespace sol{
    map<LL,int> m1;

    void solve(){
        LL n,m;
        int i,j,k;
        LL a,b,c;
        cin>>n>>m;
        m1[n-m/2]++,m1[n+1]--;
        if(m>=2){
            a=(m-2)/2;
            m1[n]++,m1[n+a+1]--;
        }
        if(m%2==0)a=-(n-m/2+1);
        else a=-(n-m/2);
        m1[-n]++,m1[a+1]--;
        m1[-n-(m-1)/2]++,m1[-n+1]--;
        a=0;
        LL s=0;
        for(auto node:m1){
            if(a==0)b=node.first;
            a+=node.second;
            if(a==0)s+=node.first-b;
        }
        cout<<s<<endl;
    }
}

int main(){
    sol::solve();
}


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

    bool check(ll X,ll Y,ll R){return X*X+Y*Y<=R*R;}
    ll f(ll x,ll y,ll R,ll st){
      int l=0,r=1;
      ll cnt=0;
      for(int i=int(1e9)+50000;i>=st;i-=10000){
        while(check(x-l*10000,i-y,R)){l--;}
        while(check(r*10000-x,i-y,R)){r++;}
        cnt+=r-l-1;
      }
      return cnt;
    }

    int main() {
      long double a,b,c;cin>>a>>b>>c;
      ll x=round(a*10000),y=round(b*10000),r=round(c*10000);
      x%=10000,y%=10000;
      ll ans=f(x,y,r,10000)+f(x,-y,r,0);
      cout<<ans<<endl;
      return 0;
    }

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
  long long ans=0;
  long double x,y,r;
  	cin >> x >> y >> r;
  r+=1e-14;
  long long a = (long long)ceil(x-r);

  for(int i=a;i<=x+r;i++){
      		ans += floor(y+sqrt(r*r-(x-i)*(x-i)))-ceil(y-sqrt(r*r-(x-i)*(x-i)))+1;
  }

  cout << ans << endl;

  return 0;
}


#include<cstdio>
const int mod=998244353;
long long cqpow(long long bas,int fur)
{
	long long res=1;
	while(fur)
	{
		if(fur&1)	res=res*bas%mod;
		bas=bas*bas%mod;
		fur>>=1;
	}
	return res;
}
int n,m,k;
long long ans;
int main()
{
	scanf("%d %d %d",&n,&m,&k);
	if(n==1)	ans=cqpow(k,m);
	else if(m==1)	ans=cqpow(k,n);
	else
	{
		for(int i=1;i<=k;++i)	ans=(ans+((cqpow(i,n)-cqpow(i-1,n)+mod)%mod)*cqpow(k-i+1,m)%mod)%mod;
	}
	printf("%lld\n",ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i,a,b,c) for(ll i=a;i<b;i+=c)
#define For2(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define vec_ll vector<vector<ll>>
#define vec_pr vector<pair<ll,ll>>
#define p_ll pair<ll,ll>
#define pbk push_back
#define mkpr make_pair
#define fst first
#define snd second

void print(ll *arr, ll n){
    For(i,0,n,1)cout<<arr[i]<<" ";
    cout<<"\n";
}

void print_vec(vector<ll> &vec, ll n){
    For(i,0,n,1)cout<<vec[i]<<" ";
    cout<<"\n";
}

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

ll fast_expo(ll a, ll x, ll p){
    //cout<<a<<" ";
    ll curr=a;
    ll ans=1;
    while(x!=0){
        if(x%2==1){
            ans=(ans*curr)%p;
        }
        x/=2;
        curr=(curr*curr)%p;
    }
    return ans;
}

//
ll calc_pow(ll base, ll expo){
	ll ans=1;
	For(i,0,expo,1)ans*=base;
	return ans;
}

//

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

    ll p=1000000007;

    //Find the primes
    /*vector<ll> prime;
    ll len=0;
    prime.pbk(2);
    prime.pbk(3);
    len=2;
    For(i,5,448,1){
    	ll ptr=0;
    	ll root=sqrt(i);
    	bool poss=true;

    	while(prime[ptr]<=root){
    		if(i%prime[ptr]==0){
    			poss=false;
    			break;
    		}
    		ptr++;
    	}

    	if(poss==true){
    		prime.pbk(i);
    		len++;
		}
    }
    */

	ll N,P;
	cin>>N>>P;

	//Algorithm
	ll ans=(P-1);
	ans=(ans*fast_expo(P-2,N-1,p))%p;

	//Output
	cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod=1e9+7;
ll x,y,a,b,res;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

cin>>x>>y>>a>>b;

ll cnt=0;

while((double)a*x<=2e18 && x*a<=x+b  && x*a<y)
{
  x=x*a;
  cnt++;
}

res=((y-x-1)/b);

res=res+cnt;

cout<<res<<endl;

return 0;

}

#include <iostream>
#include <algorithm>
#include <vector>

#define int long long

using namespace std;

int32_t main() {
	ios::sync_with_stdio(false);
	int a[4];
	cin >> a[1] >> a[2] >> a[3];
	sort(a + 1, a + 1 + 3);
	if(a[1] == a[2] && a[1] != a[3]) cout << a[3];
	else if(a[2] == a[1] && a[2] == a[3]) cout << a[3];
	else if(a[2] == a[3] && a[1] != a[2]) cout << a[1];
	else cout << 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define test() int t;cin>>t;for(int test=1;test<=t;test++)
#define pb push_back
#define nl cout<<"\n"
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

const ll MOD = 1000000007;
ll mod( ll n, ll m=MOD ){ n%=m,n+=m,n%=m;return n; }

const int MAXN = 1e5+5;
const int LOGN = 21;
const ll INF = 1e14;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

template<class T1, class T2> void add( T1 &x, T2 y, ll m = MOD )
{
    x += y;
    if( x >= m )
        x -= m;
}

template<class T1, class T2> void sub( T1 &x, T2 y, ll m = MOD )
{
    x -= y;
    if( x < 0 )
        x += m;
}

int main()
{
    #ifdef gupta_samarth
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    fastio();

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

	// (a+b) - (c+d) == k
	// (a+b) == k + (c+d)
	ll ans = 0;
	for(int lower=2;lower<=2*n;lower++)
	{
		int upper = lower + k;

		if( upper > 2*n )
			break;
		if( upper < 2 )
			continue;

		// 1 + upper-1
		// 2 + upper-2
		// 3 + upper-3
		// ..
		// x + upper-x;
		// ..
		// n/2 + upper-n/2
		// x + n, n = upper - x
		// x = upper - n;
		// ll x = max( 0, upper-n-1 );

		// ll ways_lower = 0;
		// ll ways_upper = 0;

		// for(int a=1;a<=n;a++)
		// {
		// 	if( 1 <= upper-a && upper-a <= n )
		// 		ways_upper++;
		// 	if( 1 <= lower-a && lower-a <= n )
		// 		ways_lower++;
		// }

		ll ways_lower = 2 * ( lower/2 - max(0, lower-n-1) ) - ( lower%2 == 0 );
		ll ways_upper = 2 * ( upper/2 - max(0, upper-n-1) ) - ( upper%2 == 0 );

		// if( x != ways_lower || y != ways_upper )
		// {
		// 	assert(false);
		// 	cout<<x<<" MY "<<y,nl;
		// 	cout<<ways_lower<<" orig "<<ways_upper,nl;
		// 	cout<<lower<<" "<<upper<<" "<<n,nl;
		// }

		ans += ways_upper * ways_lower;
	}
	cout<<ans,nl;

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

// C++ (GCC 9.2.1)
// 解き直し.
// https://atcoder.jp/contests/arc116/editorial/892
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define a first
#define b second
const LL MOD = 998244353;
const int LIMIT = 202020;
LL FAC[LIMIT], INV[LIMIT];

// Fermat's little theorem から, 大きな冪乗の計算を行う.
// @param a: べき乗したい正整数.
// @param b: 指数.
// @return:  べき乗した計算結果(mod版).
LL mPow(LL a, LL b){
    LL t = 1;
    while(b){
        if(b & 1) t = (t * a) % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return t % MOD;
}

// 組み合わせ(nCk)計算用(mod版).
// ※配列FAC, INV は, 事前に計算済のものを使う.
// @param n: 対象となる要素の個数.
// @param k: 選択する要素の個数.
// @return: 組み合わせ(nCk)の計算結果(mod版).
LL combination(LL n, LL k){
    if(n < 0 || k < 0 || k > n) return 0LL;
    if(n == k || k == 0LL) return 1LL;
    LL ret = FAC[n] * INV[k] % MOD * INV[n - k] % MOD;
    return ret;
}

int main(){

    // 1. 入力情報.
    int N, M;
    scanf("%d %d", &N, &M);
    FAC[0] = 1;
    repx(i, 1, LIMIT) FAC[i] = (LL)i * FAC[i - 1] % MOD;
    rep(i, LIMIT) INV[i] = mPow(FAC[i], MOD - 2);

    // 2. 素数の抽出.
    set<int> st;
    st.insert(2);
    repex(i, 3, 500, 2) {
        bool isPrime = true;
        repex(j, 3, sqrt(i) + 1, 2) {
            if(i % j == 0){
                isPrime = false;
                break;
            }
        }
        if(isPrime) st.insert(i);
    }
    // for(auto &p : st) printf("%d ", p);
    // puts("");

    // 3. 解説通り.
    LL ans = 1;
    repx(k, 2, M + 1){
        // 2-1. 素因数分解を行う.
        int n = k;
        map<int, int> m;
        for(auto &p : st){
            while(n % p == 0){
                n /= p;
                m[p]++;
            }
        }

        // 2-2. n が 素数 の 場合(ex. 2 * 3 * 5 * 521 などの場合).
        if(n != 1) m[n] = 1;

        // 2-3. A[N] = k の場合 を 計算.
        LL t = 1;
        for(auto &p : m){
            t *= combination((LL)(N + p.b - 1), (LL)p.b);
            t %= MOD;
        }

        // 2-4. 加算.
        ans += t;
        ans %= MOD;
    }

    // 4. 出力.
    printf("%lld\n", ans);
    return 0;

}


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

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

  vector<long long> a(n), p(n), x(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i) >> p.at(i) >> x.at(i);
  }

  bool check = false;
  long long ans;
  for (int i = 0; i < n; i++) {
    if (a.at(i) < x.at(i)) {
      check = true;
      ans = p.at(i);
      break;
    }
  }
  if (check) {
    for (int i = 0; i < n; i++) {
      if (a.at(i) < x.at(i)) {
        ans = min(ans, p.at(i));
      }
    }
  }
  else {
    ans = -1;
  }

  cout << ans << endl;
}

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

#define ll              long long int
#define scan(any)       for(auto &i:any) cin>>i;
#define print(any)      for(auto i:any) cout<<i<<" ";
#define endl            '\n'
#define pb              push_back
#define vll             vector<ll>
#define f(i,x,y)        for(i=x;i<y;i++)
#define INF             LLONG_MAX
#define s(x)            sort(x.begin(),x.end())
#define all(v)          v.begin(),v.end()
#define p2(n,x)         cout << fixed << setprecision(x) <<n<<endl;
#define pll             pair<ll,ll>
#define mll             map<ll,ll>
#define ff              first
#define ss              second
#define blt(x)          __builtin_popcount(x)

void solve()
{
    ll i,j,k,n;
    cin>>n;
    vll a(n),p(n),x(n);
    vll v;
    f(i,0,n)
    {
        cin>>a[i]>>p[i]>>x[i];
        x[i]-=a[i];
        if(x[i]>0)
            v.pb(p[i]);
    }
    s(v);
    if(!v.size())
        cout<<-1;
    else
        cout<<v[0];

}

int main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);

    ll t = 1;
    while(t--) {
        solve();
    }
    return 0;
}


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

using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using ld = long double;

typedef tree<
        int,
        null_type,
        less<int>,
        rb_tree_tag,
        tree_order_statistics_node_update>
        ordered_set;

#define mp make_pair

const int MOD =  998244353;

int mul(int a, int b) {
    return (1LL * a * b) % MOD;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=MOD) s-=MOD;
    return s;
}

int sub(int a, int b) {
    int s = (a+MOD-b);
    if (s>=MOD) s-=MOD;
    return s;
}

int po(int a, ll deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, MOD-2);
}

mt19937 rnd(time(0));

/*
const int LIM = 1e5 + 5;

vector<int> facs(LIM), invfacs(LIM);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<LIM; i++) facs[i] = mul(facs[i-1], i);
    invfacs[LIM-1] = inv(facs[LIM-1]);
    for (int i = LIM-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    if (n<k) return 0;
    if (n<0 || k<0) return 0;
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}
*/

/*struct DSU
{
    vector<int> sz;
    vector<int> parent;
    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        find_set(a);
        find_set(b);

        a = find_set(a);
        b = find_set(b);

        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        };
    }

    DSU (int n)
    {
        parent.resize(n);
        sz.resize(n);
        for (int i = 0; i<n; i++) make_set(i);
    }
};*/

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

    int n; cin>>n;
    vector<int> a(n); for (int i = 0; i<n; i++) cin>>a[i];
    sort(a.begin(), a.end());

    //Need to count sum of a[i] * a[j] * 2^(j-i-1) = sum of a[j]*2^j * sum of (a[i]/2^i)

    int deg = 1; int invdeg = inv(2); int inv2 = inv(2);

    int ans = 0;

    int cur = 0;
    for (int i = 0; i<n; i++)
    {
        ans = add(ans, mul(cur, mul(a[i], deg)));
        cur = add(cur, mul(a[i], invdeg));
        deg = mul(deg, 2);
        invdeg = mul(invdeg, inv2);
        //cout<<cur<<' '<<ans<<endl;
    }
    for (int i = 0; i<n; i++) ans = add(ans, mul(a[i], a[i]));

    cout<<ans<<endl;

}

/*
2 3 4

Should give: 3*3 + 3*2 = 15 -> 19
 */

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

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

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

    void solve(){
      int n;
      cin>>n;
      vector<ll>a(n);
      rep(i,n){cin>>a[i];}
      sort(a.begin(),a.end());
      mint ans=0,s=a[n-1];
      for(int i=n-2;i>=0;i--){
        ans+=s*a[i];
        s*=2;
        s+=a[i];
      }
      rep(i,n){ans+=a[i]*a[i];}
      cout<<ans<<endl;
    }
    int main(){
      solve();
      return 0;
    }


#include<bits/stdc++.h>
#define REP(i,b,e) for(int i=(b);i<(e);i++)
#define RREP(i,b,e) for(int i=(e)-1;i>=(b);i--)
using T = std::tuple<int,int,int,int>;

int n, X[200], Y[200], R[200];
int put[10000][10000],  scores[4], maxid;
int ltx[200], lty[200], rbx[200], rby[200];
bool row_has[10000], row_has_lazy[10000];
int width[200], height[200];
std::vector<T> ans[4];

void init(){
	REP(i, 0, 10000) row_has[i] = row_has_lazy[i] = false;
	REP(i, 0, n){
		ltx[i] = X[i], lty[i] = Y[i];
		rbx[i] = X[i]+1, rby[i] = Y[i]+1;
		row_has[Y[i]] = true;
		put[X[i]][Y[i]] = i + 1;
	}
}

double calcP(int r, int s){
	double tmp = 1 - std::min(r, s) / (double) std::max(r, s);
	tmp *= tmp;
	return 1 - tmp;
}

int scoring(std::vector<T> arr){
	double sum = 0;
	int idx = 0;
	for(auto [a,b,c,d]: arr) sum += calcP((d-b)*(c-a), R[idx++]) / n;
	return int64_t(sum * 1e9);
}

int main(){
    scanf("%d", &n);
	REP(i, 0, n) scanf("%d %d %d", &X[i], &Y[i], &R[i]);
	REP(i, 0, 4) ans[i].resize(n);

	init();
	REP(y, 0, 10000){
		int idx = -1;
		REP(x, 0, 10000){
			if(put[x][y]){
				if(idx>=0) rbx[idx] = x;
				else ltx[put[x][y]-1] = 0;
				idx = put[x][y] - 1;
			}
		}
		if(idx>=0) rbx[idx] = 10000;
	}
	REP(i, 0, n) width[i] = rbx[i] - ltx[i];

	REP(i, 0, n){
		height[i] = 1;
		while(rby[i]<9999 && !row_has[rby[i]] && width[i] * height[i] < R[i]){
			row_has_lazy[rby[i]] = true;
			rby[i]++;
			height[i]++;
		}
	}
	REP(i, 0, 10000) row_has[i] |= row_has_lazy[i];
	RREP(i, 0, n){
		while(lty[i]>0 && !row_has[lty[i]-1] && width[i] * height[i] < R[i]){
			lty[i]--;
			height[i]++;
		}
	}
	REP(i, 0, n) ans[0][i] = {ltx[i], lty[i], rbx[i], rby[i]};
	scores[0] = scoring(ans[0]);

	init();
	REP(y, 0, 10000){
		int idx = -1;
		REP(x, 0, 10000){
			if(put[x][y]){
				if(idx>=0) rbx[idx] = x;
				else ltx[put[x][y]-1] = 0;
				idx = put[x][y]-1;
			}
		}
		if(idx>=0) rbx[idx] = 10000;
	}
	REP(i, 0, n) width[i] = rbx[i] - ltx[i];

	RREP(i, 0, n){
		while(lty[i]>0 && !row_has[lty[i]-1] && width[i] * height[i] < R[i]){
			row_has_lazy[rby[i]] = true;
			lty[i]--;
			height[i]++;
		}
	}
	REP(i, 0, 10000) row_has[i] |= row_has_lazy[i];
	REP(i, 0, n){
		height[i] = 1;
		while(rby[i]<9999 && !row_has[rby[i]] && width[i] * height[i] < R[i]){
			rby[i]++;
			height[i]++;
		}
	}
	REP(i, 0, n) ans[1][i] = {ltx[i], lty[i], rbx[i], rby[i]};
	scores[1] = scoring(ans[1]);
	if(scores[1] > scores[0]) maxid = 1;

	for(auto [a,b,c,d]: ans[maxid]) printf("%d %d %d %d\n", a, b, c, d);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int SIZE = 10000;

template <class T> void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}

template <class T> void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}

struct Rect {
  int x1, y1, x2, y2;
};

struct S {
  int x;
  int y;
  int r;
  Rect rect;
};

int dist(const S& a, const S& b) {
  int x = abs(a.x - b.x);
  int y = abs(a.y - b.y);
  return int(sqrt(x * x + y * y) / 2);
}

void f(vector<S>& v) {
  vector<int> dist_min(v.size(), SIZE);
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v.size(); ++j) {
      if (i == j) {
        continue;
      }
      chmin(dist_min[i], dist(v[i], v[j]));
    }
  }
  for (int i = 0; i < v.size(); ++i) {
    int dx = max(0, int(dist_min[i] / sqrt(2)));
    int dy = dx;
    Rect& r = v[i].rect;
    r.x1 -= dx;
    r.y1 -= dy;
    r.x2 += dx;
    r.y2 += dy;
    chmax(r.x1, 0);
    chmax(r.y1, 0);
    chmin(r.x2, SIZE);
    chmin(r.y2, SIZE);
  }
}

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

  vector<S> v(n);
  for (int i = 0; i < n; ++i) {
    S& vi = v[i];
    cin >> vi.x >> vi.y >> vi.r;
    vi.rect.x1 = vi.x;
    vi.rect.y1 = vi.y;
    vi.rect.x2 = vi.x + 1;
    vi.rect.y2 = vi.y + 1;
  }

  f(v);

  for (int i = 0; i < n; ++i) {
    Rect& r = v[i].rect;
    printf("%d %d %d %d\n", r.x1, r.y1, r.x2, r.y2);
  }
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

vector <long long> snuke;

int main() {

  long long n;
  cin >> n;
  for(long long i = 1;i * i <= n;i++){
    if(n % i == 0 && i * i != n){
      snuke.push_back(i);
      snuke.push_back(n / i);
    }else if(i * i == n){
      snuke.push_back(i);
    }
  }

  sort(snuke.begin(),snuke.end());
  for(int i = 0;i < snuke.size();i++){
    cout << snuke[i] << '\n';
  }
  return 0;
}

#include<bits/stdc++.h>
#define            pb            push_back
#define            pl            pair<ll,ll>
#define            pll           pair<ll,pair<ll,ll>>
#define            ll            long long
#define            vl            vector<ll>
#define            fastio        ios_base::sync_with_stdio(false); cin.tie(NULL);
#define            mp            make_pair
#define            w(t)          int t;cin>>t;while(t--)
#define            inf           1e18
#define            fi(a,n)       for(ll i=a;i<n;i++)
#define            fr(i,a,b)     for(ll i=a;i>=b;i--)
#define            fj(a,n)       for(ll j=a;j<n;j++)
#define            k(a,n)        for(ll k=a;k<n;k++)
#define            endl          "\n"
#define            all(v)        (v).begin(),(v).end()
#define            set1(x)       __builtin_popcount(x)
#define            gcd(a,b)      __gcd(a,b)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
using namespace std;
const ll mod= 1000000007;
const ll N =1000005;
void solve()
{
    ll n;
    cin>>n;
    cout<<100-(n%100)<<endl;
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
     // w(t)
    	solve();

}


#include <bits/stdc++.h>

#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define FILL0(x) memset(x,0,sizeof(x))
#define FILL1(x) memset(x,-1,sizeof(x))

using namespace std;

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

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

int w, h;

bool used[100][100];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};

vector<string> s;

int dfs(int y, int x){
    int ans = 0;
    rep(i, 4){
        int ny = y + dy[i];
        int nx = x + dx[i];

        while(0<=ny && 0<=nx && ny<h &&nx<w && !used[ny][nx] && s[ny][nx]=='.'){
            used[ny][nx] = true;
            ans++;
            ny += dy[i];
            nx += dx[i];
        }
    }
    return ans;
}

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

    FILL0(used);

    int x, y;
    cin >> h >> w  >> y >> x;
    x--; y--;
    rep(i, h){
        string ss;
        cin >> ss;
        s.push_back(ss);
    }
    used[y][x] = true;
    cout << dfs(y, x)+1 << endl;

    return 0;

}

/*Bismillahir Rahmanir Rahim*/
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define PI acos(-1.0)
using namespace std;
int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,m,x,y,p,q;
    cin>>n>>m>>x>>y;
    char a[109][109];
    ll i,j,cnt=0;
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++) cin>>a[i][j];
    }
    x--;y--;
    p=x-1,q=y;
    while(a[p][q]!='#'&&p>=0) {cnt++;p--;}
    p=x+1,q=y;
    while(a[p][q]!='#'&&p<n) {cnt++;p++;}
    p=x,q=y-1;
    while(a[p][q]!='#'&&q>=0) {cnt++;q--;}
    p=x,q=y+1;
    while(a[p][q]!='#'&&q<m) {cnt++;q++;}
    cnt++;
    cout<<cnt<<endl;
}


#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("avx2")

#include <bits/stdc++.h>

int N, M;
std::vector<int> H;
std::vector<int> W;

void input(void){
    std::cin >> N >> M;
    H.resize(N);
    for (int& hi : H)
        std::cin >> hi;
    W.resize(M);
    for (int& wi : W)
        std::cin >> wi;
    std::sort(
        H.begin(), H.end()
    );
    std::sort(
        W.begin(), W.end()
    );
}

std::vector<int> acc1;
std::vector<int> acc2;

void constructAcc(void){
    acc1.resize(N, 0);
    for (int i = 2; i < N; i += 2){
        acc1[i] = acc1[i - 2] + H[i - 1] - H[i - 2];
    }
    acc2.resize(N, 0);
    for (int i = N - 3; i >= 0; i -= 2){
        acc2[i] = acc2[i + 2] + H[i + 2] - H[i + 1];
    }
}

int solve(void){
    int ret = 1000000000;
    auto left = [](int i) -> int{
        return acc1[i + 1];
    };
    auto right = [](int i) -> int{
        return acc2[i - 1];
    };
    for (int wi : W){
        auto iter = std::lower_bound(
            H.begin(), H.end(), wi
        );
        int idx = iter - H.begin();
        if (idx % 2){
            int tmp = left(idx - 2) + right(idx);
            tmp += wi - H[idx - 1];
            ret = std::min(ret, tmp);
        }
        else{
            int tmp = left(idx - 1) + right(idx + 1);
            tmp += H[idx] - wi;
            ret = std::min(ret, tmp);
        }
    }
    return ret;
}

int main(void){
    input();
    constructAcc();
    std::cout << solve() << std::endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
void printVec(vector<int> &vec) {
  for (auto itr = vec.begin(); itr != vec.end(); itr++) cout << *itr << " ";
  cout << endl;
}

struct UnionFind {
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
  vector<int> size_vec;

  UnionFind(int N) : par(N), size_vec(N) { //最初は全てが根であるとして初期化
    for(int i = 0; i < N; i++) {
      par[i] = i;
      size_vec[i] = 1;
    }
  }

  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
    int tmp = size_vec[rx];
    size_vec[rx] += size_vec[ry]; // rootを見ないとsize_vecは正しくない
    size_vec[ry] += tmp;
    par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
  }

  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }

  int size(int x) {
    return size_vec[root(x)]; // rootを見ないとsize_vecは正しくないためrootを設定
  }
};

int main() {
  int N; cin >> N;
  vector<int> a(N/2);
  vector<int> b(N/2);
  if(N % 2 == 0) {
    rep(i,N) {
      if(i < N/2) cin >> a[i];
      else cin >> b[i - N/2];
    }
  } else {
    rep(i,N) {
      if(i == (N-1)/2) {
        int dump;
        cin >> dump;
        continue;
      }
      if(i < N/2) cin >> a[i];
      else cin >> b[i - (N+1)/2];
    }
  }
  reverse(b.begin(), b.end());
  UnionFind tree(200100);
  for(int i = 0; i < N/2; i++) {
    if(a[i] != b[i]) {
      tree.unite(a[i], b[i]);
    }
  }
  // UnionFindが完成した
  ll ans = 0;
  // rootの値を足していく
  rep(i,200100) {
    if(tree.root(i) != i) continue;
    ans += tree.size(i) - 1;
  }
  cout << ans << endl;
}

// 連結成分(集合)が複数あるから、単純にset集合だと1つの集合に対してしか合っていない
// →UnionFindを使う


#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 1000000007 // 10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main()
{
	int T;
	cin >> T;
	vector<int> ans(T);
	REP(i, T){
		string S;
		cin >> S;
		if("atcoder"<S){
			ans[i] = 0;
		}else{
			int pos = -1;
			REP(k, S.size()){
				if(S[k]!='a'){
					if(S[k]<='t'){
						pos = k;
					}else{
						pos = k-1;
					}
					break;
				}
			}
			ans[i] = pos;
		}
	}
	for(auto v : ans){
		cout << v << endl;
	}
}

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

#define rep(i, a, b) for(int i=a; i<=b; i++)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()
#define pb push_back
#define f first
#define s second
#define nl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MOD = 1e9+7;
// const int MOD = 998244353;
template<class T> using pqg = priority_queue<T,vector<T>,greater<T>>;

int x, y;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);

  cin >> x >> y;
  if(min(x, y)+3>max(x, y)){
    cout << "Yes" << nl;
  }
  else cout << "No" << nl;
}


#include <bits/stdc++.h>
#include <fstream>
using namespace std;
typedef long long int64;
typedef vector<int> vec;
typedef vector<int64> vec64;
#define ss cout << " ";
#define nn cout << "\n";
#define ct(x) cout << x;
#define cts(x) cout << x << " ";
#define ctn(x) cout << x << "\n";
#define db(x) cout << "> " << #x << ": " << x << "\n";
#define qr queries();
void solve(int);
void YN(bool b){if (b){ctn("YES");}else{ctn ("NO");}};
void yn(bool b){if (b){ctn("Yes");}else{ctn ("No");}};
void queries(){int n;cin >> n;for (int i = 1; i <= n; i++) solve(i);}
int64 ceildiv(int64 a, int64 b) {return a / b + !!(a % b);}
// // // // // // // // // // // // // // // // // // // // // //
/*                  TEMPLATE - VANILLA                         */
// // // // // // // // // // // // // // // // // // // // // //
const int maxn = 200200;
const int64 mod = 1000000007;
const double pi = 3.14159265359;

void solve(int id){

    return;
}

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n,m,x,y;
    cin >> n >> m >> x >> y;
    string a [n];
    x--;
    y--;
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int rs = 0;
    for (int i = x; i >= 0; i--){
        if (a[i][y] == '#') break;
        rs++;
    }
    for (int i = x+1; i < n; i++){
        if (a[i][y] == '#') break;
        rs++;
    }
    for (int j = y-1; j >= 0; j--){
        if (a[x][j] == '#') break;
        rs++;
    }
    for (int j = y+1; j < m; j++){
        if (a[x][j] == '#') break;
        rs++;
    }
    ctn(rs);
    return 0;
}

#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <list>
#include <string>
using namespace std;
#define rep(i,n) for (ll i=0;i<(n);i++)
typedef long long ll;
bool aaa[11111111];
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  ll h,w,x,y,a=0,b=1,c=1,n,m,memo=0,sx=0,sy=1,ans=0,gx,gy;
  string ka,ss;
  cin>>h>>w>>x>>y;
  vector<string> map(h);
  rep(i,h){cin>>ka;
  map[i]=ka;
  }
  if(map[x-1][y-1]=='#')ans=0;
  else{
    ans=1;
  rep(i,x-1){
    if(x-2-i>=0){
      if(map[x-2-i][y-1]=='#'){break;}
      else{ans++;}
    }
  }
  rep(i,y-1){
    if(y-2-i>=0){
      if(map[x-1][y-2-i]=='#'){break;}
      else{ans++;}
    }
  }
    rep(i,h){
    if(x+i<=h-1){
      if(map[x+i][y-1]=='#'){break;}
      else{ans++;}
    }
  }
  rep(i,w){
    if(y+i<=w-1){
      if(map[x-1][y+i]=='#'){break;}
      else{ans++;}
    }
  }
  }
  cout<<ans<<endl;
}


#include <cstdio>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <iostream>
#include <sstream>
#include <ostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <iomanip>
#include <set>
#include <bitset>
//#include<unordered_map>
#define INT_MINs -2000000000
#define INT_MAXs 1000000001
#define MID int mid=(l+r)/2
#define REP1(i,x,y) for(int i=x;i<y;i++)
#define REP2(i,x,y) for(int i=x;i<=y;i++)
#define ls (2*k)
#define rs (2*k+1)
#define lson l,mid,2*k
#define rson mid+1,r,2*k+1
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define IOS ios::sync_with_stdio(0);cin.tie(NULL);
#define pb(a) push_back(a)
#define pi acos(-1)
#define endl '\n'
//#define int long long
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e9+7;
const ll ba=131;
//ll qk(ll x,ll y){ll ans=1;while(y){if(y&1) ans=ans*x;y>>=1;x=x*x;}return ans;}
const int dx[8] = { 0,-1,0,1,-1,-1,1,1}, dy[8] = { -1,0,1,0,-1,1,-1,1};
const int dxx[8]= {2,1,-1,-2,-2,-1, 1, 2},dyy[8]= {1,2,2,1, -1,-2,-2,-1};
ll dp[2005][2005],sum[3][2005][2005];
char str1[2005][2005];
void solve()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",str1[i]+1);
    dp[1][1]=1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(i==j&&i==1) continue;
            if(str1[i][j]=='#'){
                sum[1][i][j]=sum[2][i][j]=sum[0][i][j]=0;
            }else{
                sum[0][i][j]=(sum[0][i-1][j-1]+dp[i-1][j-1])%mod;
                sum[1][i][j]=(sum[1][i-1][j]+dp[i-1][j])%mod;
                sum[2][i][j]=(sum[2][i][j-1]+dp[i][j-1])%mod;
                dp[i][j]=(dp[i][j]+sum[0][i][j]+sum[1][i][j]+sum[2][i][j])%mod;;
                //cout<<dp[i][j]<<endl;
            }
        }
    }
    cout<<dp[n][m]<<endl;
}
int main()
{
    //IOS;
    solve();
    return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<numeric>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
#define PI acos(-1.0)

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;
//using mint = modint998244353;

int dh[] = {-1,0,1,0};
int dw[] = {0,1,0,-1};

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
    int n,m; cin >> n >> m;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    ll sum = 0;
    rep(i,n) sum += a[i];
    if(n+m < n+sum){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 1;
    repr(i,1,n+sum+1){
        ans *= (n+m-i+1)*modinv(i,MOD)%MOD;
        ans %= MOD;
    }
    cout << ans << endl;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A.at(i);
  P p;
  p = {0,0};
  int cnt;

  for(int i=2; i<=1000; ++i){
    cnt=0;
    rep(j,N){
      if(A.at(j)%i==0) ++cnt;
    }
    if(p.first<cnt) p = {cnt, i};
  }

  cout << p.second << endl;

  return 0;
}

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

namespace my {
/*汎用*/
template <typename T>
void input_vec(vector<T> &a, ll n) {
  assert(a.empty());
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
}
template <typename T>
void input_set(set<T> &a, ll n) {
  assert(a.empty());
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.insert(tmp);
  }
}

char itoc(int i) { return i + '0'; }
int ctoi(char c) { return c - '0'; }

/*整数*/
ll gcd(ll a, ll b) {  // O( log(max(a,b)) )
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll lcm(ll a, ll b) { return a * (b / my::gcd(a, b)); }  // O( log(max(a,b)) )
ll modinv(ll n, ll mod) {                               // O( log(max(n,mod)) )
  assert(mod > 0 && my::gcd(n, mod) == 1);
  n %= mod;
  if (n < 0) n += mod;
  ll a = mod, b = n, x = 1, y = 0;
  while (b != 0) {
    ll q = a / b, r = a % b;
    a = b;
    b = r;
    y -= q * x;
    swap(x, y);
  }
  y %= mod;
  if (y < 0) y += mod;
  return y;
}
ll modpow(ll a, ll n, ll mod) {  // O( log(n) )
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= a;
    ret %= mod;
    a *= a;
    a %= mod;
    n >>= 1;
  }
  return ret;
}
ll fastpow(ll a, ll n) {  // O( log(n) )
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= a;
    a *= a;
    n >>= 1;
  }
  return ret;
}

bool is_prime(ll n) {  // O( sqrt(n) )
  bool flag = true;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      flag = false;
      break;
    }
  }
  return flag;
}
vector<pair<ll, ll>> prime_factorize(ll n) {  // O( sqrt(n) )
  vector<pair<ll, ll>> ret;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i != 0) continue;
    ll exp = 0;
    while (n % i == 0) {
      n /= i;
      exp++;
    }
    ret.push_back(make_pair(i, exp));
  }
  if (n != 1) ret.push_back(make_pair(n, 1));
  return ret;
}
vector<ll> divisors(ll n) {  // O( sqrt(n) )
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (n / i != i) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

/*union find*/
class unionfind {
 private:
  /*根のparの値は「-(その木の要素数)」とする*/
  ll n_;
  vector<ll> par;

 public:
  unionfind(ll n) : n_(n), par(n, -1) {}  // O(n)

  ll root(ll a) {  // O( log(n) )
    assert(0 <= a && a < n_);
    if (par.at(a) < 0)
      return a;
    else {
      par.at(a) = root(par.at(a));  //経路圧縮
      return par.at(a);
    }
  }

  void unite(ll a, ll b) {  // O( log(n) )
    assert(0 <= a && a < n_);
    assert(0 <= b && b < n_);
    if (root(a) == root(b))
      return;
    else {
      ll ra = root(a), rb = root(b);
      if (-par.at(ra) < -par.at(rb)) swap(ra, rb);  //サイズによる併合
      par.at(ra) += par.at(rb);
      par.at(rb) = ra;
    }
  }

  bool is_same(ll a, ll b) {  // O( log(n) )
    assert(0 <= a && a < n_);
    assert(0 <= b && b < n_);
    return root(a) == root(b);
  }

  ll size(ll a) {  // O( log(n) )
    assert(0 <= a && a < n_);
    return -par.at(root(a));
  }

  vector<vector<ll>> groups() {  // O(n)
    vector<vector<ll>> ret(n_);
    for (ll i = 0; i < n_; i++) {
      ret.at(root(i)).push_back(i);
    }
    ret.erase(remove_if(ret.begin(), ret.end(),
                        [](const vector<ll> &v) { return v.empty(); }),
              ret.end());
    return ret;
  }
};
}  // namespace my
////////////////////////////////////////////////

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &ai : a) cin >> ai;

  sort(a.begin(), a.end());
  int ans = a.front();
  int cntans = 0;
  for (int i = 2; i <= a.back(); i++) {
    int cnt = 0;
    for (auto &aj : a) {
      if (aj % i == 0) cnt++;
    }
    if (cnt > cntans) {
      ans = i;
      cntans = cnt;
    }
  }

  cout << ans << endl;
}


#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; string S, X; cin >> N >> S >> X;

    vector<int> dp(7, 0);
    dp[0] = 1;

    for (int i = N - 1; i >= 0; i--) {
        int cur = S[i] - '0';
        vector<int> next(7, 0);
        if (X[i] == 'T') {
            REP(i, 0, 7) {
                if (dp[(10 * i) % 7] || dp[(10 * i + cur) % 7]) next[i] = 1;
            }
        } else {
            REP(i, 0, 7) {
                if (dp[(10 * i) % 7] && dp[(10 * i + cur) % 7]) next[i] = 1;
            }
        }
        dp = next;
    }
    if (dp[0]) cout << "Takahashi" << endl;
    else cout << "Aoki" << endl;
    return 0;
}

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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
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 (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll N;
    string c;
    cin >> N >> c;

    V<char> dec = {'B', 'R', 'W'};
    map<char, ll> mp;
    REP(i, 3) mp[dec[i]] = i;

    auto comb = [](ll x, ll y){
        ll res = 1;
        REP(i, y) res *= (x-i);
        REP(i, y) res /= (y-i);
        res %= 3;
        return res;
    };

    ll res = 0;
    REP(i, N){
        V<ll> p;
        ll tmp = N-1;
        while(tmp > 0){
            p.push_back(tmp%3);
            tmp /= 3;
        }
        ll sz = p.size();
        V<ll> q;
        tmp = i;
        REP(j, sz){
            q.push_back(tmp%3);
            tmp /= 3;
        }

        ll v = 1;
        REP(j, sz){
            v *= comb(p[j], q[j]);
            v %= 3;
        }

        res += v * mp[c[i]];
        res %= 3;
    }

    if(N%2 == 0){
        cout << dec[(3-res)%3] << endl;
    }else{
        cout << dec[res] << endl;
    }

    return 0;
}


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

int main()
{
    ll int t;
    cin>>t;
    while(t--)
    {
        ll int n;
        cin>>n;
        ll int m=(n-2)%4;
        if(m==0){cout<<"Same"<<endl;}
        else if(m==1||m==3||n==1){cout<<"Odd"<<endl;}
        else{cout<<"Even"<<endl;}
    }
}

// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで str[0]=toupper(str[0]);
// g++ hoge.cpp -std=c++17 -I . でコンパイルできる
// -fsanitize=undefinedでオーバーフロー検出
#include <bits/stdc++.h>
//#include <atcoder/all>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define endl '\n'
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
//using namespace atcoder;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    ll a,b,c,d,m,n,k,x,y,maxi=0,f=0,mini=INF,sum=0;
    string str;
    cin>>n;
    //vector<vector<ll>> v(tate,vector<ll> (yoko));
    vector<ll> v(n);
    rep(i,n)   cin >> v[i];
    rep(i,n){
        if(v[i]%2!=0) cout<<"Odd"<<endl;
        else if(v[i]%4==0) cout<<"Even"<<endl;
        else cout<<"Same"<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define reg register
#define x1 x11
#define x2 x22
#define y1 y11
#define y2 y22
#define z1 z11
#define z2 z22
const int mod=998244353;
const int maxn=6e5+5;
const int INF=2e18;
const double Pi=acos(-1.0);
const double Exp=1e-6;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0' || ch>'9')
	{
		if(ch=='-')
		f=-1;
		ch=getchar();
	}
	while(ch>='0' && ch<='9')
	{
		x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}
int n,m;
int mul(int x,int y,int mod)
{
	int res=1;
	while(y)
	{
		if(y & 1)
		res=res*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return res%mod;
}
int pre[maxn];
int ans=0;
signed main()
{
	pre[0]=1;
	for(int i=1;i<=5000;i++)
	pre[i]=pre[i-1]*i%mod;
	n=read(),m=read();
	for(int len=1;len<=n-1;len++)
	{
		int cnt=n-len-1;
		int wns=mul(m,cnt,mod)%mod;
		wns=wns*(n-len)%mod;
		int res=0;
		for(int i=2;i<=m;i++)
		{
			res=(res+(i-1)*mul(m-i,len-1,mod)%mod)%mod;
		}
		wns=wns*res%mod;
		ans=(ans+wns)%mod;
	}
//	cout<<"ans="<<ans<<endl;
	for(int i=1;i<=n;i++)
	{
		int cnt=n-i;
		int wns=mul(m,cnt,mod)%mod;
		int res=0;
		for(int j=1;j<=m;j++)
		{
			res=(res+mul(m-j,i-1,mod)%mod)%mod;
		}
		wns=wns*res%mod;
		ans=(ans+wns)%mod;
	}
	printf("%lld\n",ans);
	return 0;
}
/*

2 2 4
3 2
5 6

*/

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

using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using ld = long double;

typedef tree<
        int,
        null_type,
        less<int>,
        rb_tree_tag,
        tree_order_statistics_node_update>
        ordered_set;

#define mp make_pair

const int MOD =  998244353;

int mul(int a, int b) {
    return (1LL * a * b) % MOD;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=MOD) s-=MOD;
    return s;
}

int sub(int a, int b) {
    int s = (a+MOD-b);
    if (s>=MOD) s-=MOD;
    return s;
}

int po(int a, ll deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, MOD-2);
}

mt19937 rnd(time(0));

/*
const int LIM = 1e6 + 5;

vector<int> facs(LIM), invfacs(LIM);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<LIM; i++) facs[i] = mul(facs[i-1], i);
    invfacs[LIM-1] = inv(facs[LIM-1]);
    for (int i = LIM-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    if (n<k) return 0;
    if (n<0 || k<0) return 0;
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/

/*struct DSU
{
    vector<int> sz;
    vector<int> parent;
    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        else
        {
            auto par = find_set(parent[v]);
            parent[v] = par;
            return par;
        }
    }

    void union_sets(int a, int b) {
        find_set(a);
        find_set(b);

        a = find_set(a);
        b = find_set(b);

        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        };
    }

    DSU (int n)
    {
        parent.resize(n);
        sz.resize(n);
        for (int i = 0; i<n; i++) make_set(i);
    }
};*/

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

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

    vector<vector<int>> degs(m+1, vector<int>(n+1));

    for (int i = 1; i<=m; i++)
    {
        degs[i][0] = 1;
        for (int j = 1; j<=n; j++) degs[i][j] = mul(degs[i][j-1], i);
    }

    ll tot = mul(n, degs[m][n]);
    for (int len = 1; len<=n-1; len++)
    {
        int sum = 0;
        for (int val = 1; val<=m; val++)
        {
            if (val==m && len>1) continue;
            //probability = 1/m^2 + (m - val)^(len-1)
            int cnt = degs[m][n - len - 1];
            if (len>=2) cnt = mul(cnt, degs[m - val][len-1]);
            sum = add(sum, cnt);
        }
        tot = sub(tot, mul(sum, n-len));
    }

    cout<<tot;

}

/*
f(n, m) = f(n, m-1) + //Case when there are several ones

 */


#include <bits/stdc++.h>
/*#include <iostream>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <sstream>*/

#define ll long long
#define fop(i,m,n) for(int i=m; i<n; i++)
#define fastIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()

using namespace std;

const long long MOD = 1e9+7;
const long long N = 1e18+5;
const long long Nlog = 17;
const long long Hash = 257;

const double PI = 2.0*acos(0.0);//<cmath>
//const double PI = 3.141592653;
const double E = 2.718281828;

void solve(){

    int x, y;
    cin >> x >> y;
    if(x == y) cout << x;
    else{
        cout << 3-(x+y);
    }

}

int main()
{
    fastIO;

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

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define mp(a,b) make_pair(a,b)
#define vi vector<int>
#define mii map<int,int>
#define mpi map<pair<int,int>,int>
#define vp vector<pair<int,int> >
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define F first
#define S second
#define endl "\n"
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define dom 998244353
#define pi 3.14159265
#define sl(a) (int)a.length()
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define mini 2000000000000000000
#define time_taken 1.0 * clock() / CLOCKS_PER_SEC
//mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//primes for hashing 937, 1013
template<typename T, typename U> static inline void amin(T &x, U y)
{
    if (y < x)
        x = y;
}
template<typename T, typename U> static inline void amax(T &x, U y)
{
    if (x < y)
        x = y;
}
void shikhar7s(int cas)
{
    int n,m,i;
    cin>>n>>m;
    int u,v;
    int ed[n+5][n+5];
    memset(ed,0,sizeof(ed));
    fr(i,m)
    {
        cin>>u>>v;
        ed[u-1][v-1]=1;
        ed[v-1][u-1]=1;
    }
    int nn=(1ll<<n),j,k;
    int dp[nn+5],lc[nn+5],va[nn+5]={0};
    rep(i,1,nn)
    {
        fr(j,n)
        {
            if((1ll<<j)&i)
            {
                lc[i]=j;
                break;
            }
        }
    }
    rep(i,1,nn)
    {
        vi w;
        fr(j,n)
        {
            if((1ll<<j)&i)
                w.pb(j);
        }
        int f=0;
        fr(j,sz(w)-1)
        {
            rep(k,j+1,sz(w))
            {
                if(!ed[w[j]][w[k]])
                {
                    f=1;
                    break;
                }
            }
            if(f)
                break;
        }
        if(f)
        {
            dp[i]=mini;
            int mm=(1ll<<sz(w));
            rep(j,1,mm/2)
            {
                va[j]=va[(j-(1ll<<lc[j]))]+(1ll<<w[lc[j]]);
                //cout<<va[j]<<" "<<j<<" "<<lc[j]<<" "<<w[j]<<" "<<sz(w)<<endl;
                dp[i]=min(dp[i],dp[va[j]]+dp[i-va[j]]);
            }
        }
        else
            dp[i]=1;
    }
    cout<<dp[i-1];
}
signed main()
{
    fast;
    int t=1;
    //cin>>t;
    int cas=1;
    while(cas<=t)
    {
    shikhar7s(cas);
    cas++;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long

int main()
{
	double n,d,h;
	cin>>n>>d>>h;
	vector<pair<double,double>> v;
	for(int i = 0;i<n;i++)
	{
		ll dt,ht;
		cin>>dt>>ht;
		v.push_back({dt,ht});
	}
	double ans = INT_MAX;
	for(int i = 0;i<n;i++)
	{
		ll check = 0;
		double dt = v[i].first,ht = v[i].second;
		double c = (ht*d - dt*h)/(d-dt);
		double m = (h-ht)/(d-dt);
		if(c < 0)
		{
			m = (h)/(d);
			c = 0;
		}
		for(int j = 0;j<n;j++)
		{
			if((m*v[j].first + c) >= v[j].second)
			{
				check++;
			}
		}
		if(check == n)
		{
			ans = min(ans,c);
		}
	}

	cout<<ans<<"\n";
}

#include<bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <chrono>
#include <complex>
using namespace std;
#define ll long long
#define ld long double
#define ui unsigned int
#define ull unsigned ll
#define mp                   make_pair
#define eb                   emplace_back
#define pb                   push_back
#define pf                   push_front
#define popb                 pop_back
#define popf                 pop_front
#define hashmap              unordered_map
#define hashset              unordered_set
#define lb                   lower_bound
#define ub                   upper_bound
#define all(a)               (a).begin(), (a).end()
#define rall(a)              (a).rbegin(), (a).rend()
#define ff                   first
#define ss                   second
#define foi(n) for(ll i=0;i<n;i++)
#define foj(n) for(ll j=0;j<n;j++)
#define fok(n) for(ll k=0;k<n;k++)
#define forr(i,a,b) for(ll i=a;i<b;i++)
#define forrr(i,b,a) for(ll i=b;i>=a;i--)
#define forrrr(i,a,b,k) for(ll i=a;i<b;i=i+k)
#define graph          vector<vector<int>>
#define sz(v) v.size()
typedef pair<int, int> pii;
typedef pair<ll, ll>   pll;
typedef vector<int>         vi;
typedef vector<ll>          vll;
typedef vector<string>      vs;
typedef vector<double>      vd;
typedef vector<pii>         vpii;
typedef vector<pll>         vpll;
typedef pair< ll, pll>      plll;
typedef vector<plll>      vplll;
typedef  vector<string> 	     vs;
typedef  vector<char>	         vc;
typedef  vector<bool>            vb;
typedef  map<string, int>         msi;
typedef  map<int, int>	         mii;
typedef  map<ll, ll>             mll;
typedef  map<char, int>           mci;
typedef  map<int, string>	     mis;
typedef  pair<string, int>       psi;
typedef  pair<string, string>    pss;
typedef priority_queue <ll> pq;
typedef priority_queue<pii, vector<pii>, greater<pii> > pqq;
const ll MOD = 1000000007;
ll TT = 1;
void solve();
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("error1.txt", "w", stderr);
	freopen("output1.txt", "w", stdout);
#endif

	//ll t ; cin >> t;
	//while (t--)
	{
		solve();
		cout << "\n";
	}

	cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
	return 0;
}
ll ceils(ll x, ll y) {
	return x / y + ((x % y) != 0);
}
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 / gcd(a, b) * b;
}
void solve()
{
	ll n, d, h;
	cin >> n >> d >> h;
	vpll x;
	foi(n) {
		ll y, z;
		cin >> y >> z;
		x.pb(mp(y, z));
	}
	ld ans = 0;
	foi(n) {
		ans = max(ans, (ld)x[i].ss - ((ld)h - (ld)x[i].ss) / ((ld)d - (ld)x[i].ff) * (ld)x[i].ff);
	}
	cout << fixed << setprecision(10);
	cout << ans;

}


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

int main() {
  int a[4];
  for (int i = 0; i < 4; i++) cin >> a[i];
  sort(a, a + 4);
  if (a[0] + a[3] == a[1] + a[2] || a[0] + a[1] + a[2] == a[3])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i,a,n) for(ll i=a;i<n;i++)
#define w(x) ll _t;cin>>_t;f(x,1,_t+1)
#define br cout<<"\n"
#define N 400001
ll md=1e9+7;

bool fun(ll a[],ll i,ll small,ll sm){
    if(i==4){
        return (small-sm)==sm;
    }
    return fun(a,i+1,small,sm+a[i]) || fun(a,i+1,small,sm);
}

int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    char x[]={'A','B','C'};
    //w(_x)
    {
        ll a[4];
        f(i,0,4) cin>>a[i];
        ll small=0;f(i,0,4) small+=a[i];
        if(fun(a,0,small,0)) cout<<"Yes";
        else
        cout<<"No";
    }
    return 0;
}


/*
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma")
//*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn  = 3e6;
const ll mod =998244353;
const ld PI = acos((ld)-1);

#define pb push_back
#define endl '\n'
#define dokme(x) cout << x , exit(0)
#define migmig ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(x , y) memset(x , y , sizeof x)
ll pw(ll a, ll b, ll md = mod){ll res = 1;while(b){if(b&1){res=(a*res)%md;}a=(a*a)%md;b>>=1;}return(res);}

ll fact[maxn];

ll inv[maxn];

ll n , k;

ll a[maxn];

ll sum[maxn];

int32_t main(){
    migmig;
	cin >> n >> ::k;
	fact[0] = inv[0] = 1;
	for(int i = 1 ; i <= ::k ; i ++)
		fact[i] = (fact[i - 1] * i)%mod , inv[i] = pw(fact[i] , mod - 2);
	for(int i = 1 ; i <= n ; i ++)
		cin >> a[i];
	for(int i = 0 ; i <= ::k ; i ++)
		for(int j = 1 ; j <= n ; j ++)
			sum[i] = (sum[i] + pw(a[j] , i))%mod;
	for(int x = 1 ; x <= ::k ; x ++){
		ll ans = 0;
		for(int k = 0 ; k <= x ; k ++){
			ll res = (sum[k] * sum[x - k])%mod;
			res = (res * inv[k])%mod;
			res = (res * inv[x - k])%mod;
			ans = (ans + res)%mod;
		}
		ans = (ans * fact[x])%mod;
		ans = (ans - (sum[x] * pw(2 , x))%mod + mod)%mod;
		cout << (ans*pw(2 , mod - 2))%mod << endl;
	}
    return(0);
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define rsort(a) {sort(all(a));reverse(all(a));}
#define pb emplace_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),(k))-v.begin())
#define ub(v,k) (upper_bound(all(v),(k))-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
#define dupli(a) {sort(all(a));a.erase(unique(all(a)),a.end());}
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
typedef multiset<ll> S;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vvvvi=vector<vvvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001001;
const ll INF=1001001001;
const ll mod=998244353;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){ll res=1;a%=mod;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;}

int main(){
    ll a,b,n;cin>>a>>b>>n;
    vi v(n);
    rep(i,n){
        v[i]=modpow(i+1,a);
    }
    if(a==1)dame(modpow(n,b));
    if(b==1)dame(modpow(n,a));
    ll ans=0;
    rep(i,n){
        ll r=v[i];
        if(i)r-=v[i-1];
        r+=mod;
        r%=mod;
        ans+=r*modpow(n-i,b)%mod;
    }
    out(ans%mod);
}


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

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

using namespace std;

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}
template <class Con>
string concat(const Con &c, const string &spr){
	stringstream ss;
	typename Con::const_iterator it = c.begin(), en = c.end();
	bool fst = true;
	for(; it != en; ++it){
		if(!fst){ ss << spr; }
		fst = false;
		ss << *it;
	}
	return ss.str();
}

template <class Con, class Fun>
vector<typename Con::value_type> cfilter(const Con &c, Fun f) {
	vector<typename Con::value_type> ret;
	typename Con::const_iterator it = c.begin(), en = c.end();
	for(; it != en; ++it){
		if(f(*it)){
			ret.emplace_back(*it);
		}
	}
	return ret;
}
#if __cplusplus >= 201103L
template <class Con, class Fun>
auto cmap(const Con &c, Fun f) -> vector<decltype(f(*c.begin()))> {
	vector<decltype(f(*c.begin()))> ret;
	ret.reserve(c.size());
	for(const auto &x: c){
		ret.emplace_back(f(x));
	}
	return ret;
}
#endif

#if __cplusplus >= 201402L
#define lambda(e) ([&](const auto &_){ return (e); })
#define lambda2(e) ([&](const auto &_a, const auto &_b){ return (e); })
#endif

#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()
#define tget(t,i) get<i>(t)

#define MOD 1000000007LL
#define EPS 1e-8

void mainmain(){
	LL x, y;
	cin >> x >> y;
	LL ans = abs(x - y);
	for(int i = 1; x <= y; ++i){
		x *= 2;
		LL d = abs(y - x);
		LL res = i;
		for(int j = 0; j <= i; ++j){
			if(d >> j & 1){
				++res;
				if(j < i - 2 && (d >> (j + 1) & 3) == 3){
					d += 1LL << j;
				}
				else{
					d -= 1LL << j;
				}
			}
		}
		res += d >> i;
		chmin(ans, res);
	}
	cout << ans << endl;
}

}
int main() {
//	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i,n) for(ll i=0;i<n;i++)
#define revf(i,n) for(ll i=n-1;i>=0;i--)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define inp(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define outp(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "
#define outp1(a,n) for(ll i=1;i<n;i++)cout<<a[i]<<" "
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (((a)*(b))/gcd((a),(b)))
#define pb push_back
//#define mp make_pair
#define BINSC binary_search
#define BITOUT __builtin_popcount
#define mem(x,n) memset(x,n,sizeof(x))
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define cn cout<<"\n";
ll x;
map<ll,ll>mp;
ll solve(ll y)
{
  if(mp.find(y) != mp.end())
  return mp[y];
  if(y==1)
  return mp[1] = abs(x-y);
  if(y%2==1)
  return mp[y] = min(abs(x-y), min(solve((y+1)/2)+2, solve((y-1)/2)+2));
  if(y%2==0)
  return mp[y] = min(abs(x-y), solve(y/2)+1);
}

int main()
{
     ll y;
     cin>>x>>y;
     cout<<solve(y);
     cn
}


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

    struct Point{
      double x,y;
    };

    void solve(){
      double n;
      cin>>n;
      vector<Point>p(n);
      cin>>p[0].x>>p[0].y>>p[n/2].x>>p[n/2].y;
      Point mid;
      mid.x=(p[0].x+p[n/2].x)/2;
      mid.y=(p[0].y+p[n/2].y)/2;
      double deg=acos(-1)*(360/n)/180.0;
      p[1].x=(p[0].x-mid.x)*cos(deg)-(p[0].y-mid.y)*sin(deg)+mid.x;
      p[1].y=(p[0].x-mid.x)*sin(deg)+(p[0].y-mid.y)*cos(deg)+mid.y;
      cout<<p[1].x<<" "<<p[1].y<<endl;
    }
    int main(){
      solve();
      return 0;
    }

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
using namespace std;
using P = pair<int, int>;
using ll = long long;

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

    mint inv() const {return pow(mod-2);}
    mint& operator/=(const mint a){return *this *= a.inv();}
    mint operator/(const mint a) const{return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) {return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) {return os << a.x;}

// ------------------ combination -------------------
// 組合せ nCr
struct combination{
    vector<mint> fact, ifact;
    combination(int n):fact(n+1), ifact(n+1){
        assert(n < mod);
        fact[0] = 1;
        for(int i=1; i<=n; i++)fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for(int i=n; i>=1; i--)ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k){
        if(k < 0 || k > n)return 0;
        return fact[n] * ifact[k] * ifact[n-k];
    }
};

int main()
{
    int n, m, k;
    cin >> n >> m >> k;

    combination comb(n+m+5);

    if(n - k > m){
        cout << 0 << endl;
        return 0;
    }

    mint ans = comb(n+m, n);

    if(k < n){
        ans -= comb(n+m, n-(k+1));
    }

    cout << ans << endl;

    return 0;
}