//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
//#define endl '\n'
llo dp[1001];
llo mod=1e9+7;
llo n;

llo aa[2][2];
llo pre[2001];
llo pre2[2001];

llo ee(llo aa,llo bb){
	if(bb==0){
		return 1;
	}
	llo ac=ee(aa,bb/2);
	ac=(ac*ac)%mod;
	if(bb%2==1){
		ac=(ac*aa)%mod;
	}
	return ac;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n;
	for(llo i=0;i<2;i++){
		for(llo j=0;j<2;j++){
			string s;
			cin>>s;
			aa[i][j]=s[0]-'A';
		}
	}
	pre[0]=1;
	for(llo i=1;i<=2*n;i++){
		pre[i]=(pre[i-1]*i)%mod;
	}
	for(llo i=0;i<=2*n;i++){
		pre2[i]=ee(pre[i],mod-2);
	}

	if(aa[0][1]==1 and aa[1][1]==1){
		cout<<1<<endl;
		return 0;
	}
	if(aa[0][1]==0 and aa[0][0]==0){
		cout<<1<<endl;
		return 0;
	}
	if(n==2){
		cout<<1<<endl;
		return 0;
	}
	if(aa[0][1]==0){
		if(aa[1][0]==1){
			llo ans=1;
			for(llo i=0;i<n-3;i++){
				ans=(ans*2)%mod;
			}
			cout<<ans<<endl;
			return 0;
		}
		else{
			llo ans=0;
			for(llo i=1;i<=n-1;i++){
				llo le=n-i-1;
				if(le<=i-1){

					llo cot=pre[i-1]*pre2[le];
					cot%=mod;
					cot=(cot*pre2[i-1-le])%mod;
					ans=(ans+cot)%mod;
				}
			}
			cout<<ans<<endl;
		}

	}
	else{
		if(aa[1][0]==0){
			llo ans=1;
			for(llo i=0;i<n-3;i++){
				ans=(ans*2)%mod;
			}
			cout<<ans<<endl;
			return 0;
		}
		else{
			llo ans=0;
			for(llo i=1;i<=n-1;i++){
				llo le=n-i-1;
				if(le<=i-1){

					llo cot=pre[i-1]*pre2[le];
					cot%=mod;
					cot=(cot*pre2[i-1-le])%mod;
					ans=(ans+cot)%mod;
				}
			}
			cout<<ans<<endl;
		}

	}
	/*dp[2][2]=1;
	for(llo i=2;i<=n-1;i++){
		for(llo j=1;j<=i;j++){
			if(dp[i][j]==0){
				break;
			}
			llo x=j/2;
		}
	}
	llo ans=0;
	for(llo i=1;i<=n;i++){
		ans=(ans+dp[n][i])%mod;
	}
	cout<<ans<<endl;*/

	/*for(llo i=1;i<n;i++){
		for(llo k=0;k<2;k++){
			for(llo j=0;j<i;j++){
				llo st=0;
				if(i==n-1 and k==1){
					st=1;
				}
				if(aa[k][k]==)

			}

		}
	}

	cout<<dp[0]
*/

	return 0;
}

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

/*
    実行時MODint :
    template <int& MOD = 1000000007>
    static int MOD;
    cin >> MOD;
*/
template <int MOD = 1000000007>
struct Mint {
    int x;

    constexpr Mint() : x(0) {}
    constexpr Mint(long long t)
        : x(t >= 0 ? (t % MOD) : (MOD - (-t) % MOD) % MOD) {}

    Mint pow(int n) {
        Mint res(1), t(x);
        while (n > 0) {
            if (n & 1) res *= t;
            t *= t;
            n >>= 1;
        }
        return res;
    }

    Mint inv() const {
        int a = x, b = MOD, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        return Mint(u);
    }

    Mint &operator+=(Mint a) {
        x += a.x;
        if (x >= MOD) x -= MOD;
        return *this;
    }

    Mint &operator-=(Mint a) {
        x += MOD - a.x;
        if (x >= MOD) x -= MOD;
        return *this;
    }

    Mint &operator*=(Mint a) {
        x = int(1LL * x * a.x % MOD);
        return *this;
    }

    Mint &operator/=(Mint a) {
        return (*this) *= a.inv();
    }

    Mint operator+(Mint a) const {
        return Mint(x) += a;
    }
    Mint operator-(Mint a) const {
        return Mint(x) -= a;
    }
    Mint operator*(Mint a) const {
        return Mint(x) *= a;
    }
    Mint operator/(Mint a) const {
        return Mint(x) /= a;
    }

    Mint operator-() const {
        return Mint(-x);
    }

    bool operator==(const Mint a) {
        return x == a.x;
    }
    bool operator!=(const Mint a) {
        return x != a.x;
    }
    bool operator<(const Mint a) {
        return x < a.x;
    }

    friend ostream &operator<<(ostream &os, const Mint &a) {
        return os << a.x;
    }

    friend istream &operator>>(istream &is, Mint &a) {
        int t;
        is >> t;
        a = Mint<MOD>(t);
        return (is);
    }
};

signed main() {
    int n;
    cin >> n;
    char caa, cab, cba, cbb;
    cin >> caa >> cab >> cba >> cbb;
    if (n <= 3) {
        cout << 1 << endl;
        return 0;
    }
    if ((cab == 'A' && caa == 'A') || (cab == 'B' && cbb == 'B')) {
        cout << 1 << endl;
        return 0;
    }
    if ((cab == 'A' && caa == 'B' && cba == 'A') ||
        (cab == 'B' && cbb == 'A' && cba == 'B')) {
        Mint<> dp[n][2];
        dp[0][0] = 1;
        rep(i, n - 1) {
            dp[i + 1][0] += dp[i][1];
            dp[i + 1][1] += (dp[i][0] + dp[i][1]);
        }
        cout << dp[n - 1][1] << endl;
        return 0;
    }
    cout << Mint<>(2).pow(n - 3) << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<cstdio>
#include<map>
#include<cassert>

using namespace std;

#define ll long long
#define reps(i, a, b) for(int i = a; i < b; i++)
#define rreps(i, a, b) for(int i = a-1; i >= b; i--)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) rreps(i, n, 0)
#define P pair<int, int>
#define vec vector<int>
#define mat vector<vector<int> >

const ll mod = 1000000007;
const int INF = 1001001001;

int n;
vec c;
mat g;
map<int, int> path;
vec ans;

void dfs(int node, int old){
    rep(i, g[node].size()){
        int nx = g[node][i];
        if(old == nx) continue;
        if(path.find(c[nx]) == path.end()) {
            path[c[nx]] = 1;
            ans.push_back(nx);
        }else path[c[nx]]++;
        dfs(nx, node);
        if(path[c[nx]] == 1) path.erase(c[nx]);
        else path[c[nx]]--;
    }
}

int main(){
    cin >> n;
    c = vec(n);
    rep(i, n) cin >> c[i];
    g = mat(n);
    rep(i, n-1) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    path[c[0]] = 1;
    dfs(0, -1);
    sort(ans.begin(), ans.end());
    cout << 1 << endl;
    rep(i, ans.size()){
        cout << ans[i] + 1 << endl;
    }
}

#include<bits/stdc++.h>
using namespace std;
#define intt long long int
#define intu unsigned long long int
#define vi vector<int>
#define ii pair<int,int>
#define pb push_back
//#define mp make_pair
#define ff first
#define ss second
#define fast_io ios::sync_with_stdio(0);cin.tie(NULL);std::cout.tie(NULL);
# define PI           3.14159265358979323846
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
int mod = 1000000007;
int gcd(int a, int b) {return b ? gcd(b, a % b) : a;}
int lcm(int a, int b) {return a * b / gcd(a, b); }
intt bpow(intt a,intt b)
{
  intt res = 1;
  while (b > 0) {
    if (b & 1)res = ((res%mod) * (a%mod))%mod;
      a = ((a%mod) * (a%mod))%mod;
      b >>= 1;
  }
  return res;
}
intt fact(intt n) {
   if ((n==0)||(n==1))
      return 1;
   else
      return n*fact(n-1);
}
void go()
{
#ifndef ONLINE_JUDGE
  freopen("in.txt","r",stdin);
  freopen("OUt.txt","w",stdout);
  #endif
}

bool isValid(int i,int j,int n,int m){
  if(i<=0 || j<=0 || i==n+1 || j==m+1)
    return 0;
  return 1;
}
int dx[4]={0,0,-1,1};
int dy[4]={1,-1,0,0};
char v[1001][1001]={};
int vis[1001][1001]={};
int p[100001]={};
int ans=0,n,m,k;
void dfs(int x,int y,int i){

  vis[x][y]=i;
  for(int h=0;h<4;h++){
    int nx=x+dx[h];
    int ny=y+dy[h];
    if(isValid(nx,ny,n,m) && v[nx][ny]=='*')
      ans++;
    else if(isValid(nx,ny,n,m) && v[nx][ny]=='.' && !vis[nx][ny])
        dfs(nx,ny,i);
  }
}

int main()
{
    fast_io
    go();
  int n,x,sum=0,v,p,i;
  cin>>n>>x;
  x=x*100;
  for(i=0;i<n;i++)
  {
      cin>>v>>p;
      sum=sum+(v*p);
      if(sum>x)
      {
      cout<<i+1<<endl;
      break;

      }

  }
  if(i==n)
  {
      cout<<"-1";
  }
  return 0;
}
/*!
    You are under no obligation to be the same person you were a minute ago,
    You have the right to grow !
*/


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

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;}
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    ll n,ans;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    ans=a[0];

    rep(i,n){
        ans=gcd(ans,a[i]);
    }

    cout << ans << endl;

    return 0;
}

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

int main() {
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];

  sort(A.begin(), A.end());
  A.erase(unique(A.begin(), A.end()), A.end());
  while (A.size() > 1) {
    int v = A[0];
    for (int i = 1; i < A.size(); ++i) {
      if (A[i] % A[0]) v = min(v, A[i] % A[0]);
      else A[i] = A[0];
    }
    if (v) A.push_back(v);
    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());
  }

  cout << A[0] << endl;
}


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

const int mx = 2e5 + 9;

int par[mx];
ll ans;

int find_parent(int x) {
    if (x == par[x]) return x;
    return par[x] = find_parent(par[x]);
}

void join(int u, int v) {
    int p_u = find_parent(u), p_v = find_parent(v);
    if (p_u == p_v) return;

    ans++;
    par[p_u] = p_v;
    return;

}

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

   for (int i = 0; i < mx; i++) {
        par[i] = i;
   }

   ll a[n + 2];
   for(ll i = 0; i < n; i++) {
    cin >> a[i];
   }

   for(ll i = 0; i < n; i++) {
    ll b = a[i];
    ll c = a[n - i - 1];
    join(b, c);

   }

   cout << ans << '\n';

}

#include <bits/stdc++.h>

#define ll long long
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define REP(i,a) for (int i = 0; i < (a); i++)
#define add push_back
using namespace std;
template<typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;

const ll MOD = 1000000007LL;
//const ll MOD = 998244353LL;

int ni() {
    int x; cin >> x;
    return x;
}

ll nl() {
    ll x; cin >> x;
    return x;
}

double nd() {
    double x; cin >> x;
    return x;
}

string next() {
    string x; cin >> x;
    return x;
}

struct DisjointSetUnion {
    vi parent;
    vi weight;
    int count; //number of components

    DisjointSetUnion(int N) {
        count = N;
        parent.assign(N,0);
        REP(i,N) parent[i] = i;
        weight.assign(N,1);
    }

    //"find"
    int root(int p) {
        if (p==parent[p])
            return p;
        int r = root(parent[p]);
        parent[p] = r;
        return r;
    }

    //"union"
    void connect(int p, int q) {
        p = root(p);
        q = root(q);
        if (p==q) return;

        if (weight[p]<weight[q]) {
            parent[p] = q;
            weight[q] += weight[p];
        } else {
            parent[q] = p;
            weight[p] += weight[q];
        }
        count--;
    }

    bool connected(int p, int q) {
        return root(p)==root(q);
    }
};

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

    int N = ni();
    vi nums(N);
    REP(i,N) {
        nums[i] = ni()-1;
    }

    DisjointSetUnion dsu(200000);
    for (int i = 0; i < N; i++)
        dsu.connect(nums[i],nums[N-1-i]);

    cout << 200000-dsu.count;
}


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

inline int read()
{
	int f=1,x=0;char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-') f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=x*10+s-48;
		s=getchar();
	}
	return f*x;
}

int pri[20]={0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47},tot=15;
int a[60],n;
ll ans=1ll<<62;

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

void dfs(int x,ll s)
{
	if(s>ans) return;
	if(x>tot)
	{
		int flag=1;
		for(int i=1;i<=n;i++)
			if(gcd(s,a[i])==1)
			{
				flag=0;
				break;
			}
		if(flag) ans=s;
		return;
	}
	dfs(x+1,s*pri[x]);
	dfs(x+1,s);
}

int main()
{
	n=read();
	for(int i=1;i<=n;i++) a[i]=read();
	dfs(1,1);
	cout<<ans<<endl;
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

#define DEBUG
#ifdef DEBUG
inline void debug_print() { cerr << endl; }
template <typename T1, typename... T2> void debug_print(const T1 a, const T2 &... b) { cerr << a << ' '; debug_print(b...); }
#define debug(...) cerr << __LINE__ << ": [" << #__VA_ARGS__ << "] = " , debug_print(__VA_ARGS__);
#else
#define debug(...) true
#endif

inline void print() { cout << '\n'; }
template <typename T1, typename... T2> void print(const T1 a, const T2 &... b) { cout << a << ' '; print(b...); }

template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto e : v) os << e << ' '; return os; }
template <typename T> ostream &operator<<(ostream &os, const set<T> &v) { for (auto e : v) os << e << ' ';  return os; }
template <typename T> ostream &operator<<(ostream &os, const multiset<T> &v) { for (auto e : v) os << e << ' ';  return os; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const map<T1, T2> &mp) { for (auto e : mp) os << e << ' '; return os; }

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

//-------------------------- Libraries --------------------------//

vector<long long> sieve(long long N) {
    vector<long long> res;
    vector<long long> is_prime(N+1, true);
    is_prime[0] = is_prime[1] = false;
    for (long long i = 2; i <= N; i++) {
        if (is_prime[i]) {
            res.push_back(i);
            for (long long j = 2 * i; j <= N; j+=i) {
                is_prime[j] = false;
            }
        }
    }
    return res;
}

//---------------------------- Solve ----------------------------//

void solve() {
    int N;
    cin >> N;
    vector<int> X(N);
    int ma = 0;
    for (int i = 0; i < N; i++) {
        cin >> X[i];
        chmax(ma, X[i]);
    }

    auto primes = sieve(ma);
    int n = primes.size();

    long long ans = 1LL<<60;
    for (int bit = 0; bit < 1<<n; bit++) {
        long long tmp = 1;
        vector<int> v;
        for (int i = 0; i < n; i++) {
            if (bit & 1<<i) {
                tmp *= primes[i];
                v.push_back(primes[i]);
            }
        }
        bool flag = true;
        for (int i = 0; i < N; i++) {
            bool flag2 = false;
            for (auto &&prime : v) {
                if (X[i] % prime == 0) flag2 = true;
            }
            if (!flag2) flag = false;
        }
        if (flag) chmin(ans, tmp);
    }

    cout << ans << '\n';
}

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

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

    return 0;
}


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

struct Union{
  vector<ll> par;
  Union(ll a){
  par=vector<ll>(a,-1);
  }
  ll find(ll a){
    if(par[a]<0){
      return a;
    }
    else{
      return par[a]=find(par[a]);
    }
  }
  bool same(ll a,ll b){
    return (find(a)==find(b));
  }
  ll size(ll a){
    return -par[find(a)];
  }
  void unite(ll a,ll b){
    ll c=find(a),d=find(b);
    if(c==d)
      return;
    if(size(c)<size(d)){
      swap(c,d);
    }
    par[c]+=par[d];
    par[d]=c;
  }
};
ll euclidean_gcd(ll a, ll b) {
  if(a < b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
ll euclidean_lcm(ll a, ll b) {
  return a/euclidean_gcd(a,b)*b;
}

class smart_sieve {
  intmax_t L, R, M;
  std::vector<int> small;  // 小さい篩
  std::vector<std::vector<intmax_t>> large;  // 大きい篩
  std::vector<intmax_t> aux;  // aux[i] := large[i] の素因数の積

public:
  smart_sieve(intmax_t L, intmax_t R): L(L), R(R), M(sqrt(R)+1) {
    small.resize(M);
    std::iota(small.begin(), small.end(), 0);
    large.resize(R-L);
    aux.assign(R-L, 1);

    for (intmax_t i = 2; i*i < R; ++i) {
      if (small[i] < i) continue;
      small[i] = i;
      for (intmax_t j = i*i; j < M; j += i)
        if (small[j] == j) small[j] = i;

      for (intmax_t j = (L+i-1)/i*i; j < R; j += i) {
        intmax_t k = j;
        do {
          // aux[j-L] > M で判定した方がいいかも？
          // j / aux[j-L] < M の方がいい？（割り算したくない）
          if (aux[j-L] * aux[j-L] > R) break;

          large[j-L].push_back(i);
          aux[j-L] *= i;
          k /= i;
        } while (k % i == 0);
      }
    }
  }

  std::vector<intmax_t> factor(intmax_t n) {
    assert(L <= n && n < R);
    std::vector<intmax_t> res = large[n-L];
    n /= aux[n-L];
    if (n >= M) {
      // この場合，n は素数となることが示せる（はず）
      // n*n >= R だとオーバーフローしそう？
      res.push_back(n);
      return res;
    }
    while (n > 1) {
      res.push_back(small[n]);
      n /= small[n];
    }
    return res;
  }
};

int main(void){
  ll x,y,z;
  cin >> x >> y >> z;
  if(y*z%x==0)cout << y*z/x-1;
  else cout << y*z/x;
}

#include "bits/stdc++.h"
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    long double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, m = 0, n = 0, p = 0, q = 0, mod = 1000000007, pi = 3.1415926535;
    string s;
    char moji;
    cin >> a >> b >> c;
    d=floor(c*(b/a));
    cout << (d/c==b/a?d-1:d);
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

ll my_pow(ll a, ll b) {
	ll ret = 1;
	ll kake = a;
	REP(i, 30) {
		if(b & (1 << i))ret = ret * kake % MOD;
		kake = kake * kake % MOD;
	}

	return ret;
}

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

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

	if(N == 1 && M == 1) {
		cout << K << endl;
		return 0;
	}

	if(N == 1) {
		cout << my_pow(K, M) << endl;
		return 0;
	}
	if(M == 1) {
		cout << my_pow(K, N) << endl;
		return 0;
	}

	ll ans = 0;
	for (ll i = 1;i <= K;i++) {
		ll A = my_pow(K - i + 1, N);
		ll B = (MOD + my_pow(i, M) - my_pow(i - 1, M)) % MOD;
		ans = (ans + A * B % MOD) % MOD;
	}

	cout << ans << endl;

	return 0;
}

/**
 *    author:  avoas
 *    created: 10.05.2021 23:38:11
**/

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

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

#define all(x) (x).begin(),(x).end()

constexpr double EPS = 1e-12;

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

    long long r, x, y;
    cin >> r >> x >> y;

    long long diff2 = x*x + y*y;
    double diff = sqrt(diff2);

    int ans = 1;
    while(ans*r < diff)
    {
        ++ans;
    }

    if(diff2 == r*r)
    {
        ans = 1;
    }

    if(diff2 < r*r)
    {
        ans = 2;
    }

    cout << ans << endl;

    return 0;
}


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

#define MAXN 200007
#define MOD 998244353

int n , m ;
vector < int > divs[ MAXN ] ;

long long dp[ 21 ][ MAXN ] ;
long long fac[ MAXN ] ;
long long inv[ MAXN ] ;

long long fastpow ( long long x , long long pw ) {
    long long ret = 1 ;
    while ( pw > 0 ) {
        if ( ( pw % 2 ) == 0 ) {
            x = ( x * x ) % MOD ;
            pw /= 2 ;
        }
        else {
            ret = ( ret * x ) % MOD ;
            -- pw ;
        }
    }
    return ret ;
}

void input ( ) {
    scanf ( "%d%d" , &n , &m ) ;
    fac[ 0 ] = 1 ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        fac[ i ] = ( fac[ i - 1 ] * i ) % MOD ;
    }
    inv[ n ] = fastpow ( fac[ n ] , MOD - 2 ) ;
    for ( int i = n - 1 ; i >= 0 ; -- i ) {
        inv[ i ] = ( inv[ i + 1 ] * ( i + 1 ) ) % MOD ;
    }
    for ( int i = 2 ; i <= m ; ++ i ) {
        for ( int j = 2 * i ; j <= m ; j += i ) {
            divs[ j ].push_back ( i ) ;
        }
    }
}

void solve ( ) {
    for ( int i = 2 ; i <= m ; ++ i ) {
        dp[ 1 ][ i ] = 1 ;
    }
    for ( int i = 1 ; i <= 20 ; ++ i ) {
        for ( int j = 2 ; j <= m ; ++ j ) {
            for ( auto x : divs[ j ] ) {
                dp[ i ][ j ] += dp[ i - 1 ][ x ] ;
                if ( dp[ i ][ j ] >= MOD ) { dp[ i ][ j ] -= MOD ; }
            }
        }
    }
    long long ans = 1 ;
    for ( int i = 1 ; i <= 20 ; ++ i ) {
        long long aux = 0 ;
        for ( int j = 2 ; j <= m ; ++ j ) {
            aux += dp[ i ][ j ] ;
            if ( aux >= MOD ) { aux -= MOD ; }
        }
        if ( i > n ) { break ; }
        aux = ( aux * fac[ n ] ) % MOD ;
        aux = ( aux * inv[ i ] ) % MOD ;
        aux = ( aux * inv[ n - i ] ) % MOD ;
        ans += aux ;
        if ( ans >= MOD ) { ans -= MOD ; }
    }
    printf ( "%lld\n" , ans ) ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    t = 1 ;
    // cin >> t ;
    // scanf ( "%d" , &t ) ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)//iをaからn
#define per(i,n,a) for (int i=a-1;i>=n;i--)//iをnからa
#define db(x) cout << #x << " = " << x << endl//デバッグ用
#define db2(x, y) cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; //デバッグ用
#define all(x) (x).begin(), (x).end()
#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf
#define MOD 998244353 //10^9+7:合同式の法
#define pb push_back
#define F first
#define S second
typedef long long ll;
//sort(all(a)); ソート
//sort(all(a),greater<int>()); 逆順ソート
//a.erase(unique(all(a)), a.end()); ソート後に重複を削除
//cout<< std::fixed << std::setprecision(15)<<0.000001<<endl; 小数点以下を表示させる
//vector<vector<int>> data(3, vector<int>(4)); int型の2次元配列(3×4要素の)の宣言
//PNch[i]:=(iを割り切る最大の素数)
//但し,iが素数の時はPNch[i]=1,i=0,1の時はPNch[i]=0
vector<ll> PNch;

//n:=素因数分解したい中で最大の値(2以上)
void ES(ll n){
    //素数として初期化
    PNch.assign(n+1,1);
    PNch[0]=0;PNch[1]=0;
    ll l=sqrt(n);
    rep(i,2,l){
        //ある素数の倍数ならばその素数で割り切れる
        if(PNch[i]==1){
            rep(j,i,n/i)PNch[j*i]=i;
        }
    }
}

class PFmap{
public:
    //PNs:=(素因数分解出てくる素数を(昇順に)格納したmap)
    map<ll,ll> PNs;
    PFmap(ll n){PF(n);}
    void PF(ll n){
        if(n<=1) return;
        //nが素数の時
        if(PNch[n]==1){PNs[n]++;return;}
        //マークされている数は素数
        PNs[PNch[n]]++;
        //マークされている数でnを割った数
        PF(n/PNch[n]);
    }
};
const int MAX = 300000;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    ll N,M;
    cin >> N >>M;
    ll ans=1;

    if(M==1){
        cout<<ans;
        return 0;
    }
    if(N==1){
        cout<<M;
        return 0;
    }
    COMinit();
    ES(400000);
    rep(i,2,M+1){
        ll nowans=1;
        auto so=PFmap(i);
        //db(so.PNs.size());
        auto begin = so.PNs.begin(), end = so.PNs.end();
        //if(i==200000)db(so.PNs.size());

        for (auto iter = begin; iter != end; iter++) {
            ll aaa=iter->second;
        if(aaa == 1){
            nowans*=N;
            nowans%=MOD;
        }else{
            nowans*=COM(N+aaa-1,aaa);
            nowans%=MOD;
        }
        }
        //db(nowans);
        ans+=nowans;
        ans%=MOD;
    }
    cout<<ans;

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


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using ll = long long;
using Graph = vector<vector<int>>;
const long long INF = 1LL << 60;
const int SINF = 1LL << 29;
const ll mod = 1000000000+7;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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; }

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    ll max_place = 0, max_start = 0;
    ll place = 0, start = 0;
    ll ans = 0;
    rep(i, n) {
        place += a[i];
        chmax(max_place, place);
        chmax(ans, max_place + start);
        start += place;
    }
    cout << ans << endl;
}

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

int main() {
    long long int N;
    cin >> N;
    vector<long long int> A(N), cumsum(N, 0);
    for(int i = 0; i < N; ++i) cin >> A.at(i);
    if(N == 1) {
        if(A.at(0) > 0) cout << A.at(0) << endl;
        else cout << 0 << endl;
        return 0;
    }

    cumsum.at(0) = A.at(0);
    for(int i = 1; i < N; ++i) {
        cumsum.at(i) = cumsum.at(i-1) + A.at(i);
    }
    // どのloop回数で最大化を探す
    long long int sum = A.at(0), candi = 0, candsum = A.at(0);
    vector<long long int> offset(N);
    offset.at(0) = A.at(0);
    // if(sum > 0) candi = 0;
    for(int i = 1; i < N; ++i) {
        candsum += cumsum.at(i);
        offset.at(i) = candsum;
        if(candsum > sum) {
            sum = candsum; // update
            candi = i;
        }
        // cout << offset.at(i) << endl;
    }

    long long int ans = offset.at(candi);
    // candsum = sum;
    for(int i = candi; i >= 0; --i) {
        sum -= A.at(i);
        ans = max(sum, ans);
    }
    sum = offset.at(candi);
    if(candi < N-1) {
        for(int i = 0; i <= candi+1; ++i) {
            sum += A.at(i);
            ans = max(sum, ans);
        }
    }
    cout << ans << endl;

}


#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
const ll mod=1e9+7;
int main(void){
    ll n;cin>>n;
    vector<vector<ll>> dp(n+100,vector<ll>(n+100,0)); //i番目までのAをj番目のBに切り分ける組み合わせ
    vector<ll> a(n),c(n+1);                           //cはaの累積和
    rep(i,n){
        cin>>a[i];
        c[i+1]=c[i]+a[i];
    }
    ll res=0;
    dp[1][0]=1;
    rep(i,n){
        for(ll j=n;j>=1;j--){
            dp[j+1][c[i+1]%(j+1)]=(dp[j+1][c[i+1]%(j+1)]+dp[j][c[i+1]%j])%mod;
            if(i==n-1){
                res+=dp[j][c[i+1]%j];
                res%=mod;
            }
        }
    }
    cout<<res<<endl;
}

#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define ini(x, y) memset(x, y, sizeof(x));
#define pb push_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = (int)1e9 + 7;
const int MAX = (int)2e9;
const double PI = acos(-1);

int n;
ll a[3030], psum[3030][3030];
ll dp[3030][3030];
vector<int> v[3030][3030];
int main(void) {
	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			psum[i][j] = psum[i][j - 1] + a[j];
			psum[i][j] %= i;
		}
		for (int j = 1; j <= n; j++) {
			v[i][psum[i][j]].pb(j);
		}
	}
	for (int i = 1; i <= n; i++) dp[1][i] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (dp[i][j] == 0) continue;
			auto& vec = v[i + 1][psum[i + 1][j]];
			for (auto it = upper_bound(all(vec), j); it != vec.end(); ++it) {
				dp[i + 1][*it] += dp[i][j];
				if (dp[i + 1][*it] >= MOD) dp[i + 1][*it] -= MOD;
			}
		}
	}

	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += dp[i][n];
	}
	cout << ans % MOD;
}


#include <bits/stdc++.h>

const long long INF = 1e9;
const long long MOD = 1e9 + 7;
//const long long MOD = 998244353;
const long long LINF = 1e18;
using namespace std;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define COUT(x) cout<<(x)<<endl
#define SCOUT(x) cout<<(x)<<" "
#define VECCOUT(x) for(auto&youso_: (x) )cout<<right<<setw(10)<<youso_<<" ";cout<<endl
#define ENDL cout<<endl
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) long long __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define mp make_pair
#define PQ priority_queue<long long>
#define PQG priority_queue<long long,V,greater<long long>>

typedef long long ll;
typedef vector<long long> vl;
typedef vector<long long> vi;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef pair<long long, long long> pll;

#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
template<class T>
void mod(T &x) {
    x %= MOD;
    x += MOD;
    x %= MOD;
}

ll GCD(ll a, ll b) {
    if(b == 0) return a;
    else return GCD(b, a%b);
}

struct COMB{
    vl fact, fact_inv, inv;
    void init_nCk(long long SIZE) {
        fact.resize(SIZE + 5);
        fact_inv.resize(SIZE + 5);
        inv.resize(SIZE + 5);
        fact.at(0) = fact.at(1) = fact_inv.at(0) = fact_inv.at(1) = inv.at(1) = 1;
        for(long long i = 2; i < SIZE + 5; i++) {
            fact.at(i) = fact.at(i - 1)*i%MOD;
            inv.at(i) = MOD - inv.at(MOD%i)*(MOD/i)%MOD;
            fact_inv.at(i) = fact_inv.at(i - 1)*inv.at(i)%MOD;
        }
    }
    long long nCk (long long n, long long k) {
        assert(!(n < k));
        assert(!(n < 0 || k < 0));
        return fact.at(n)*(fact_inv.at(k)*fact_inv.at(n - k)%MOD)%MOD;
    }
};
ll extGCD(ll a, ll b, ll &x, ll &y) {
    if(b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a/b*x;
    return d;
}

string solve(string s) {
    string res;
    sort(s.begin(),s.end());
    string memo = s;
    reverse(s.begin(),s.end());
    res = to_string(abs(stoi(s) - stoi(memo)));
//    cout << res << endl;
    return res;
}

void Main() {
    LCIN(N, K);
    string S = to_string(N);
    for(int i = 0; i < K; i++) {
        S = solve(S);
    }
    cout << S << endl;
}

int main() {
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

#pragma comment(linker, "/STACK:1000000000")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <cassert>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#include <random>
#include <bitset>
#include <limits.h>
#include <fstream>

#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define pll pair <ll, ll>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define uint unsigned int
#define mp make_pair

const int maxn = 110;
vector <int> ed[maxn];

bool used[maxn];

int dfs(int v) {
    if (used[v]) {
        return 0;
    }

    int ans = 1;
    used[v] = true;

    for (int u : ed[v]) {
        ans += dfs(u);
    }
    return ans;
}

int main() {
    int n;
    cin >> n;
    string s;
    for (int i = 0; i < n; i++) {
        cin >> s;

        for (int j = 0; j < n; j++) {
            if (s[j] == '1') {
                ed[j].push_back(i);
            }
        }
    }

    ld ans = 0;

    for (int i = 0; i < n; i++) {
        memset(used, 0, sizeof used);
        ld num = dfs(i);
        ans += 1. / num;
    }

    printf("%.10lf\n", (double)ans);
}


#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF = 4e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void print() { print0("\n"); }
template<typename Head,typename... Tail>void print(Head head,Tail... tail){print0(head);if(sizeof...(Tail)>0)print0(" ");print(tail...);}
// clang-format on

ll gcdf(ll a, ll b) {
    if (b == 0) {
        return a;
    }
    return gcdf(b, a % b);
}

vector<ll> divisor(ll n) {
    vector<ll> res;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            res.push_back(i);
            if (i != n / i) {
                res.push_back(n / i);
            }
        }
    }
    return res;
}
int main() {
    ll N;
    cin >> N;
    vector<ll> a(N);
    ll allmin = INF;
    for (ll i = 0; i < N; i++) {
        cin >> a[i];
        allmin = min(a[i], allmin);
    }

    unordered_map<ll, ll> curgcd;
    for (auto ai : a) {
        vector<ll> succeeded;
        for (auto d : divisor(ai)) {
            if (d > allmin) continue;
            if (curgcd.count(d)) {
                curgcd[d] = gcdf(curgcd[d], ai);
            } else {
                curgcd[d] = ai;
            }
        }
    }
    ll ans = 0;
    for (auto x : curgcd) {
        ans += (x.first == x.second);
    }
    print(ans);
}

#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

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

#define mod         1000000007
#define pi          3.1415926535898
#define eps         1e-9

#define fast       ios::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define vt vector
#define ar array
#define fs          first
#define sc          second
#define pb         push_back
#define sp          printf(" ")
#define nl          '\n'
#define all(a) a.begin(),a.end()
#define unique(c) (c).resize(unique(all(c)) - (c).begin())
#define sz(x) (int)(x).size()
#define revsort(x) sort(all(x));reverse(all(x))

#define set0(a)     memset(a,0,sizeof(a))
#define setneg(a)   memset(a,-1,sizeof(a))
#define setinf(a)   memset(a,126,sizeof(a))

#define REP(i,start,end) for (int i = start; i <=end; i++)
#define RREP(i,end,start) for (int i=end; i>=start ;i--)
#define EACH(x, a) for (auto& x: a)

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<LL> vll;
typedef vector<double> vd;
typedef vector<vector<LL> > matrix;
typedef vector<vector<int> > graph;

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

int add (LL var1, LL var2) {
    return ( (var1 % mod) + (var2 % mod) + mod) % mod;
}

int mul (LL var1, LL var2) {
    return (var1*var2) % mod;
}

int powm (LL x, LL y) {
    int ans = 1;
    while (y) {
        if (y & 1) {
            ans = mul(ans, x);
        }
        x = mul(x, x);
        y /= 2;
    }
    return ans;
}

int inv(LL x) {
    return powm(x, mod-2);
}

LL INF=1e9;

void solve() {
    LL r, c, m;
    read(r,c,m);
    vector <set <int> > rows(r);
    vector <set <int> > cols(c);
    REP (i, 1, m) {
        int x, y;
        read(x,y);
        x--;
        y--;
        rows[x].insert(y);
        cols[y].insert(x);
    }
    REP(i,0,r-1) rows[i].insert(c);
    REP(i,0,c-1) cols[i].insert(r);

    LL down = *cols[0].begin();
    LL right = *rows[0].begin();
    LL ans = 0;
    REP (i, 0, down-1)
    {
        LL mxr = *rows[i].begin();
        ans += mxr;
    }
    ordered_set<int> done;
    REP (i, down, r-1) {
        done.insert(i);
    }
    REP (j, 0, right-1) {
        ans += done.order_of_key(*cols[j].begin());
        for (auto x : cols[j]) {
            done.insert(x);
        }
    }
    cout << ans << nl;

}

int main() {
    fast;
        solve();
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define Pint pair<int,int>
#define Pll pair<ll,ll>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000;
constexpr ll llINF=1000000000000000000;
constexpr int mod=1000000007;
constexpr double eps=1e-8;
const double pi=acos(-1);
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int Random(int mi,int ma){
    random_device rnd;
    mt19937 mt(rnd());//32bit
    //[mi,ma]
    uniform_int_distribution<int>engine(mi,ma);
    return engine(mt);
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
ll modpow(ll a,ll b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    ll memo=modpow(a,b/2);
    return memo*memo%mod;
}
vector<ll>kaijo,invkaijo;
void init_fact(int n){
    kaijo.resize(n+1);
    invkaijo.resize(n+1);
    kaijo[0]=1;
    for(ll i=1;i<=n;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
    rep(i,n+1)invkaijo[i]=modpow(kaijo[i],mod-2);
}
vector<vector<ll>>C,sC;
void init_comb(int n,int m){
    C.resize(n+1,vector<ll>(m+1,0));
    sC.resize(n+1,vector<ll>(m+1,0));
    C[0][0]=1;
    for(int i=1;i<=n;i++){
        C[i][0]=1;
        for(int j=1;j<=m;j++){
            C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
        }
    }
    rep(i,n+1){
        rep(j,m){
            sC[i][j+1]=(sC[i][j]+C[i][j])%mod;
        }
    }
}
ll comb(int a,int b){
    if(a<b)return 0;
    if(a<0)return 0;
    return kaijo[a]*invkaijo[a-b]%mod*invkaijo[b]%mod;
}
ll inv(ll x){
    x=modpow(x,mod-2);
    return x;
}
int n,a[2121];
ll m;
int main(){
    cin>>n>>m;
    ll s=0;
    rep(i,n){
        cin>>a[i];
        s+=a[i];
    }
    int x=n+m;
    int y=s+n;
    ll ans=1;
    for(int i=x;i>x-y;i--){
        ans*=i;
        ans%=mod;
    }
    for(int i=1;i<=y;i++){
        ans*=inv(i);
        ans%=mod;
    }
    cout<<ans<<endl;
    return 0;
}

//DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl vector<ll>
#define popcnt __builtin_popcount
#define popcntll __builtin_popcountll
#define all(a) begin(a),end(a)

using namespace std;
using namespace __gnu_pbds;

using ll=long long;
using ull=unsigned long long;
using ld=long double;
const int MOD=1000000007;
vector<int> bases;
const ll LLINF=1ll<<60;
const char en='\n';

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void yes() {cout<<"YES"<<en; exit(0);}
void no() {cout<<"NO"<<en; exit(0);}
inline int rund() {int x576363482791fuweh=rng();return abs(x576363482791fuweh)%RAND_MAX;}
template<class T>
void prVec(vector<T> w,bool fl=false)
{
	cout<<w.size()<<en;
	for (int i=0;i<int(w.size())-1;++i) cout<<w[i]<<' ';
	if (w.size()) cout<<w[w.size()-1]<<en;
	if (fl) cout<<flush;
}

ll raand()
{
	ll a=rund();
	a*=RAND_MAX;
	a+=rund();
    return a;
}

#define rand raand

ll raaand()
{
	return raand()*(MOD-7)+raand();
}

void compress(vi&v)
{
	set<int> s;
	for (auto a: v) s.insert(a);
	vi o(all(s));
	for (auto&a: v) a=lower_bound(all(o),a)-o.begin();
}

void compress(vl&v)
{
	set<ll> s;
	for (auto a: v) s.insert(a);
	vl o(all(s));
	for (auto&a: v) a=lower_bound(all(o),a)-o.begin();
}

string to_upper(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
	return a;
}

string to_lower(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
	return a;
}

ll sti(string a,int base=10)
{
	ll k=0;
	for (int i=0;i<(int)a.size();++i)
	{
		k*=base;
		k+=a[i]-'0';
	}
	return k;
}

template<class T>
void eras(vector<T>& a,T b)
{
	a.erase(find(a.begin(),a.end(),b));
}

string its(ll k,int base=10)
{
	if (k==0) return "0";
	string a;
	while (k)
	{
		a.push_back((k%base)+'0');
		k/=base;
	}
	reverse(a.begin(),a.end());
	return a;
}

ll min(ll a,int b)
{
	if (a<b) return a;
	return b;
}

ll min(int a,ll b)
{
	if (a<b) return a;
	return b;
}

ll max(ll a,int b)
{
	if (a>b) return a;
	return b;
}

ll max(int a,ll b)
{
	if (a>b) return a;
	return b;
}

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

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

template<class T,class K>
pair<T,K> mp(T a,K b)
{
	return make_pair(a,b);
}

inline int mult(ll a,ll b)
{
	return (a*b)%MOD;
}

inline int pot(int n,int k)
{
	if (k==0) return 1;
	ll a=pot(n,k/2);
	a=mult(a,a);
	if (k%2) return mult(a,n);
	else return a;
}

int divide(int a,int b)
{
	return mult(a,pot(b,MOD-2));
}

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

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

bool prime(ll a)
{
	if (a==1) return 0;
	for (int i=2;i<=round(sqrt(a));++i)
	{
		if (a%i==0) return 0;
	}
	return 1;
}

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
const int N=300010;
int n,m;

ll co(int a,int b)
{
	ll re=1;
	for (int i=a;i>a-b;--i)
	{
		re=mult(re,i);
		re=divide(re,a+1-i);
	}
	return re;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	for (int i=0;i<10;++i) bases.push_back(rand()%(MOD-13893829*2)+13893829);
	cin>>n>>m;
	ll s=0;
	for (int i=0;i<n;++i)
	{
		int a;
		cin>>a;
		s+=a;
	}
	cout<<co(m+n,s+n)<<en;
}


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

const ll MOD=1000000007;
//~ const int MOD=998244353;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

int a[200000];

int main(){
	int T;cin>>T;
	rep(Case,T){
		int n;scanf("%d",&n);
		map<int,int>mp;
		rep(i,n)scanf("%d",&a[i]),mp[a[i]]++;
		bool ok=true;
		for(auto&p:mp){
			if(p.second%2!=0)ok=false;
		}
		if(n%2==1){
			puts("Second");
		}
		else{
			if(ok)puts("Second");
			else puts("First");
		}
	}
}

#include<bits/stdc++.h>
#define lint long long
#define st first
#define nd second
#define INF 0x3f3f3f3f

using namespace std;

int t;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cin>>t;
    while(t--){
        int n; cin>>n;
        vector<lint> a(n);
        map<int,int> cont;
        for(auto &x:a) cin>>x, cont[x]++;
        lint xo = a[0];
        bool Grone = false;
        if(a[0] > 1) Grone = true;
        for(int i=1; i<n;i++){
             xo ^= a[i];
             if(a[i] > 1) Grone = true;
        }
        if(n%2 == 0){
            string win = "Second\n";
            for(auto &e:cont) if(e.nd%2) win = "First\n";
            cout<<win;
        } else{
            cout<<"Second\n";
        }
    }

    return 0;
}
/*
    num par de dishes:
        quero forçar xor de todo mundo != 0
            nd -> me imita
            st -> não me imita

    num ímpar de dishes:
        quero forçar xor de todo mundo == 0
            n == 2
            1 1 ->> 2 0
            1 2 -> 1 2
            1 1 2 2 -> 2 2
            carinha mau força

*/


#include<bits/stdc++.h>
// Program showing a policy-based data structure.
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
using namespace std;
using namespace __gnu_pbds;
typedef       long long int      ll;
// GNU link : https://goo.gl/WVDL6g
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;
#define       READ               freopen("in.txt", "r", stdin);
#define       WRITE              freopen("out.txt", "w", stdout);
#define       optimize           ios::sync_with_stdio(0);cin.tie(0);
#define       RESET(a, b)        memset(a, b, sizeof(a))
#define       gcd(a, b)          __gcd(a, b)
#define       MX                 300005
#define       MOD                1000000007
#define       inf                ll(1e18)
#define       PI                 acos(-1.0)
#define       eps                1e-9
ll LCM(ll a, ll b)
{
   return (a / __gcd(a, b)) * b;
}
int main(void)
{
   optimize
   ll n,x;
   cin>>n;
   ll lcm=1;
   for(ll j=2;j<=30;j++)
   {
      lcm=LCM(lcm,j);
   }
   lcm++;
   cout<<lcm<<endl;
   return 0;
}

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

typedef long long ll;

int main()
{
    ll n;
    cin>>n;
    if(n==30)
        n--;
    ll ans=1;
    for(ll i=n;i>=2;i--)
    {
        if(ans%i!=0){
            ans*=i;
        }
    }
    cout<<ans+1;
}

// 23 4 5


#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  endl           "\n"
#define  pb             push_back
#define  sym(s)         s="#"+s+"#";
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  debv(a)        for(auto it: a)cout<<it<<" ";cout<<endl;
#define  deb1(a)        cout<<a<<endl;
#define  deb2(a,b)      cout<<a<<" "<<b<<endl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<endl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());

typedef  long long             ll;
typedef  unsigned long long    ull;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   N  =  3e+5+7;

vll adj[N];ll vis[N]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n,a[N],q;
//<<-----Implement Functions Here---->>//
//input-array from which segtree(tree) is formed
//here example shown is min range query change as needed
//make 1 indexe input,so use build(1,1,n) etc
ll tree[4*N+8];

ll merge(ll a,ll b){
	return a^b;
}

void build(ll node, ll start, ll end){
	if(start == end){
		tree[node] = a[start];
	}
	else
	{
		ll mid = (start + end) / 2;
		build(2*node, start, mid);
		build(2*node+1, mid+1, end);
		tree[node] = merge(tree[2*node],tree[2*node+1]);
	}
}

void update(ll node, ll start, ll end, ll pos, ll val){
	if(start == end){
		tree[node] = tree[node]^val;
	}
	else
	{
		ll mid = (start + end) / 2;
		if(pos <= mid)
			update(2*node, start, mid, pos, val);
		else
			update(2*node+1, mid+1, end, pos, val);
		tree[node] = merge(tree[2*node],tree[2*node+1]);
	}
}

ll query(ll node, ll start, ll end, ll l, ll r){
	if(start > end or start > r or end < l)
		return 0;
	if(l <= start and end <= r)
		return tree[node];
	ll mid = (start + end)/2;
	ll p1 = query(2*node, start, mid, l, r);
	ll p2 = query(2*node+1, mid+1, end, l, r);
	return merge(p1,p2);
}

//<<-----Start of Main--------------->>//
void MAIN(){
		cin>>n>>q;
		for(ll i=1;i<=n;i++)cin>>a[i];
		build(1,1,n);
		while(q--){
			ll ch,x,y;
			cin>>ch>>x>>y;
			if(ch==1){
				update(1,1,n,x,y);
			}
			else cout<<query(1,1,n,x,y)<<endl;
		}
}

int main(){
    fastio;randomINIT;

    //cin>>t;
    while(t--){
        MAIN();
    }

    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}

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

using namespace std;

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

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

struct BIT {
  ll n;
  vector<ll> b;
  BIT(ll idx) : n(idx+1), b(n, 0) {}

  void init(vector<ll> a) {
    for(ll i = 0; i < a.size(); i++) {
      add(i+1, a[i]);
    }
  }

  // sum: b[1] ~ b[i];
  ll sum(ll i) {
    ll ret = 0;
    while(i > 0) {
      ret ^= b[i];
      i -= i & -i;
    }
    return ret;
  }

  // sum: b[x] ~ b[y];
  ll range_sum(ll x, ll y) {
    return sum(y) ^ sum(x-1);
  }

  void add(ll i, ll x) {
    while(i <= n) {
      b[i] ^= x;
      i += i & -i;
    }
  }
};

int main(){
  ll n, q;
  cin >> n >> q;

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

  BIT b(n);
  b.init(a);

  vector<ll> ans;
  rep(i, q) {
    ll t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      b.add(x, y);
    } else {
      ans.push_back(b.range_sum(x, y));
    }
  }

  for(auto v: ans) {
    cout << v << endl;
  }

  return 0;
}


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

#define pb push_back
#define mp make_pair
#define f1 first
#define s2 second

#define fastio ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(x...) cerr << "[" << #x << "]: " << x << "\n";

using ll = long long;
using ld = long double;
using ii = pair<int, int>;
using pl = pair<ll, ll>;

ld const PI = 4*atan((ld)1);

int main()
{
	fastio;

	set<ll> st;

	ll n;
	cin >> n;

	for (ll a = 2; a*a <= n; ++a)
	{
		for (ll x = a*a; x <= n; x *= a)
			st.insert(x);
	}
	cout << n - st.size() << '\n';

	return 0;
}

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,avx512f")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <bitset>
#include <numeric>
#include <cassert>
#include <memory>
#include <random>
#include <functional>
#include <complex>
#include <immintrin.h>
#ifdef DEBUG
#include "./CompetitiveProgrammingCpp/debug_VC.hpp"
#include "./CompetitiveProgrammingCpp/Timer.hpp"
#include "./CompetitiveProgrammingCpp/sample.hpp"
#else
#define dump(...)
#endif

/* macro */
#define FOR(i, b, e) for(ll i = (ll)(b); i < (ll)(e); ++i)
#define RFOR(i, b, e) for(ll i = (ll)(e-1); i >= (ll)(b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define REPI2(it,b,e) for(auto it = (b); it != (e); ++it)
#define REPI(it,c) REPI2(it, (c).begin(), (c).end())
#define RREPI(it,c) REPI2(it, (c).rbegin(), (c).rend())
#define REPI_ERACE2(it, b, e) for(auto it = (b); it != (e);)
#define REPI_ERACE(it, c) REPI_ERACE2(it, (c).begin(), (c).end())
#define ALL(x) (x).begin(),(x).end()
#define cauto const auto&
/* macro func */
template<class T>
inline auto sort(T& t) { std::sort(ALL(t)); }
template<class T>
inline auto rsort(T& t) { std::sort((t).rbegin(), (t).rend()); }
template<class T>
inline auto unique(T& t) { (t).erase(unique((t).begin(), (t).end()), (t).end()); }
template<class T, class S>
inline auto chmax(T& t, const S& s) { if (s > t) { t = s; return true; } return false; }
template<class T, class S>
inline auto chmin(T& t, const S& s) { if (s < t) { t = s; return true; } return false; }
inline auto BR() { std::cout << "\n"; }

/* type define */
using ll = long long;
using PAIR = std::pair<ll, ll>;
using VS = std::vector<std::string>;
using VL = std::vector<long long>;
using VVL = std::vector<VL>;
using VVVL = std::vector<VVL>;
using VD = std::vector<double>;
template<class T>
using V = std::vector<T>;

/* using std */
using std::cout;
constexpr char endl = '\n';
using std::cin;
using std::pair;
using std::string;
using std::stack;
using std::queue;
using std::vector;
using std::list;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::set;
using std::unordered_set;
using std::unordered_multiset;
using std::multiset;
using std::bitset;
using std::priority_queue;

/* Initial processing  */
struct Preprocessing { Preprocessing() { std::cin.tie(0); std::ios::sync_with_stdio(0); }; }_Preprocessing;

/* Remove the source of the bug */
signed pow(signed, signed) { assert(false); return -1; }

/* define hash */
namespace std {
template <>	class hash<std::pair<ll, ll>> { public:	size_t operator()(const std::pair<ll, ll>& x) const { return hash<ll>()(1000000000 * x.first + x.second); } };
}

/* input */
template<class T> std::istream& operator >> (std::istream& is, vector<T>& vec) { for (T& x : vec) is >> x; return is; }

/* constant value */
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;

//=============================================================================================

signed main() {
	double n;
	cin >> n;

	double ans = 0.0;

	REP(i, n - 1) {
		ans += (n / static_cast<double>(i + 1));
	}

	cout << std::setprecision(12) << std::fixed <<
		ans << endl;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

long long a, b, w;

int main()
{
	scanf("%lld%lld%lld", &a, &b, &w);
	w *= 1000;
	long long cc = w / a;
	long long dd = w % a;
	if (dd > (b - a) * cc)
	{
		printf("UNSATISFIABLE");
		return 0;
	}
	long long ans2 = 0;
	cc = w / b;
	dd = w % b;
	if (!dd)
	{
		ans2 = cc;
	}
	else
	{
		ans2 = cc + 1;
	}
	printf("%lld %lld", ans2, w / a);
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<vector>

using namespace std;

#define fori(i,a,b) for(int i=(a);i<(b);i++)
#define ford(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define mem(a,b) memset((a),(b),sizeof(a));
#define all(x) (x).begin(),(x).end()

template<class T, class T2>bool ckmax(T& a, T2 b) { return a < b ? a = b, 1 : 0; }
template<class T, class T2>bool ckmin(T& a, T2 b) { return a > b ? a = b, 1 : 0; }

typedef long long ll;

const int maxn = 2e6 + 5;
int arr[maxn], ans[maxn];

int main(void)
{
	string cant = "UNSATISFIABLE";
	int a, b, c;
	int aa, bb;
	cin >> a >> b >> c;
	c *= 1000;
	aa = c / a;
	bb = (c+b-1) / b;
	if (aa < bb) cout << cant;
	else cout << bb << ' ' << aa;
	return 0;
}


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

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

    vector<P> vec(N);
    rep(i,N) cin >> vec.at(i).first >> vec.at(i).second;

    ll answer=0;

    rep(i,N) {
        answer += (vec.at(i).second-vec.at(i).first+1)*(vec.at(i).first+vec.at(i).second)/2;
    }

    cout << answer << endl;

}

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

typedef long long ll;
#define pb push_back
#define  fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int main()
{
    fast;
    ll t=1;

    while(t--)
    {
        ll n,sum=0;
        cin>>n;
        for(ll i=0; i<n; i++)
        {
            ll a,b;
            cin>>b>>a;
            b-=1;
            sum+=((a*(a+1))/2);
            sum-=((b*(b+1))/2);
        }
        cout<<sum<<endl;
    }

}


#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <cassert>
#include <deque>
#include <map>
#include <queue>
#include <climits>
#include <set>
#include <stack>
#include <cmath>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define ll long long
#define MAX 100000
#define MAX1 10000
#define MAX2 100000
#define inf 1000000000
#define eps 1e-12
#define MOD 1000000007

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif

    int n;
    cin >> n;
    int a[n + 5], i, pos = n - 1;
    for (i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    vector<int> ans;
    for (i = n - 1; i >= 1; --i) {
        if (a[i] == i) {
            break;
        }
        if (a[i] < i) {
            continue;
        }
        if (a[i] - 1 == pos) {
            for (int j = i; j <= pos; ++j) {
                swap(a[j], a[j + 1]);
                ans.push_back(j);
            }
            pos = i - 1;
        } else {
            break;
        }
    }
    for (i = 1; i <= n; ++i) {
        if (a[i] != i) {
            break;
        }
    }
    if (i == n + 1 and pos == 0) {
        for (i = 0; i < n - 1; ++i) {
            cout << ans[i] << "\n";
        }
    } else {
        cout << "-1";
    }

    return 0;
}

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

int main(void)
{
    int N;
    cin >> N;
    vector<int> p(N,0);
    vector<bool> used(N,false);
    vector<int> ans;

    rep(i, N){
        cin >> p[i];
        --p[i];
    }
    int cc = 0;
    for(int i = 0; i < N-1; ++i)
    {
        while(1)
        {
            if((p[cc]-cc)*(p[cc+1]-cc-1) < 0)
            {
                if(used[cc])
                {
                    cout << -1 << endl;
                    return 0;
                }
                ans.push_back(cc);
                used[cc] = false;
                iter_swap(p.begin()+cc, p.begin()+cc+1);
                --cc;
                break;
            }
            else
            {
                ++cc;
                if(cc == N-1)
                {
                    cout << -1 << endl;
                    return 0;
                }
            }
        }
    }

    bool ok = true;
    rep(i,N)
    {
        if(i != p[i]) ok = false;
    }
    if(ok) rep(i, N-1) cout << ans[i]+1 << endl;
    else cout << -1 << endl;

    return 0;
}


#include <iostream>
int a[100];
int b[100];
int used[200];
int main() {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
        std::cin >> a[i] >> b[i];
        if (a[i] != -1) ++used[a[i] - 1];
        if (b[i] != -1) ++used[b[i] - 1];
        if (a[i] != -1 and b[i] != -1 and a[i] >= b[i]) {
            std::cout << "No\n";
            return 0;
        }

        if (a[i] != -1 and used[a[i] - 1] == 2) {
            std::cout << "No\n";
            return 0;
        }

        if (b[i] != -1 and used[b[i] - 1] == 2) {
            std::cout << "No\n";
            return 0;
        }
    }
    int ilen, jlen, idx, j;

    for (int i = 1; i < n; ++i) {
        j = i - 1;

        if (a[i] == -1 or b[i] == -1) continue;
        if (a[i] <= a[j] and a[j] <= b[i] and a[i] <= b[j] and b[j] <= b[i]) {
            std::cout << "No\n";
            return 0;
        }

        if (b[j] != -1) {
            if (a[i] <= a[j] and a[j] <= b[i]) {
                ilen = b[i] - a[i] + 1;
                jlen = b[j] - a[j] + 1;
                if (ilen != jlen) {
                    std::cout << "No\n";
                    return 0;
                }
            }
        } else {
            if (a[i] <= a[j] and a[j] <= b[i]) {
                ilen = b[i] - a[i];
                idx = a[j] + ilen - 1;
                if (idx < 0 or 2 * n <= idx or used[idx] == 1) {
                    std::cout << "No\n";
                    return 0;
                }
            }
        }

        if (a[j] != -1) {
            if (a[i] <= b[j] and b[j] <= b[i]) {
                ilen = b[i] - a[i] + 1;
                jlen = b[j] - a[j] + 1;
                if (ilen != jlen) {
                    std::cout << "No\n";
                    return 0;
                }
            }
        } else {
            if (a[i] <= b[j] and b[j] <= b[i]) {
                ilen = b[i] - a[i];
                idx = b[j] - ilen - 1;
                if (idx < 0 or 2 * n <= idx or used[idx] == 1) {
                    std::cout << "No\n";
                    return 0;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = i; j < n; ++j) {
            if (i == j) continue;
            if (a[i] == -1 or b[i] == -1) continue;
            if (a[i] <= a[j] and a[j] <= b[i] and a[i] <= b[j] and b[j] <= b[i]) {
                std::cout << "No\n";
                return 0;
            }

            if (b[j] != -1) {
                if (a[i] <= a[j] and a[j] <= b[i]) {
                    ilen = b[i] - a[i] + 1;
                    jlen = b[j] - a[j] + 1;
                    if (ilen != jlen) {
                        std::cout << "No\n";
                        return 0;
                    }
                }
            } else {
                if (a[i] <= a[j] and a[j] <= b[i]) {
                    ilen = b[i] - a[i];
                    idx = a[j] + ilen - 1;
                    if (idx < 0 or 2 * n <= idx or used[idx] == 1) {
                        std::cout << "No\n";
                        return 0;
                    }
                }
            }

            if (a[j] != -1) {
                if (a[i] <= b[j] and b[j] <= b[i]) {
                    ilen = b[i] - a[i] + 1;
                    jlen = b[j] - a[j] + 1;
                    if (ilen != jlen) {
                        std::cout << "No\n";
                        return 0;
                    }
                }
            } else {
                if (a[i] <= b[j] and b[j] <= b[i]) {
                    ilen = b[i] - a[i];
                    idx = b[j] - ilen - 1;
                    if (idx < 0 or 2 * n <= idx or used[idx] == 1) {
                        std::cout << "No\n";
                        return 0;
                    }
                }
            }
        }
    }
    std::cout << "Yes\n";
}

#include <bits/stdc++.h>
#include<random>
using namespace std; typedef unsigned long long _ulong; typedef long long int lint; typedef pair<lint, lint> plint; typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define endk '\n'
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; }
const lint MOD = 1e9 + 7, INF = 1e18;
lint dx[8] = { 0, -1, 1, 0, 1, -1, 1, -1 }, dy[8] = { 1, 0, 0, -1, -1, -1, 1, 1 };
typedef pair<long double, lint> Pa;
typedef pair<lint, plint> tlint;
struct edge {
	lint cost;
	lint u, v;
};
lint N, A[100], B[100];
vector<plint> ok;
lint now[200];
bool used[200];
bool dfs(lint curr, lint cnt) {
	if (cnt <= 0) return true;
	bool ans = false;
	IFOR(i, 1, cnt + 1) {
		bool _can = true;
		REP(j, i) {
			if (now[curr + j] < 2 * N && now[curr + j] >= N) _can = false;
			if (now[curr + j + i] < N) _can = false;
			if (now[curr + j] != 2 * N && now[curr + j + i] != 2 * N) {
				if (now[curr + j] + N != now[curr + i + j]) _can = false;
			}
			bool change = false;
			if (now[curr + j] < N) {
				if (used[now[curr + j]]) _can = false;
				used[now[curr + j]] = true;
				change = true;
			}
			if (now[curr + j + i] < 2 * N && now[curr + j + i] >= N) {
				if (!change && used[now[curr + j + i] - N]) _can = false;
				used[now[curr + j + i] - N] = true;
			}
		}
		if (!ans && _can) ans |= dfs(curr + i * 2, cnt - i);
		REP(j, i) {
			if (now[curr + j] < N) {
				used[now[curr + j]] = false;
			}
			if (now[curr + j + i] < 2 * N && now[curr + j + i] >= N) {
				used[now[curr + j + i] - N] = false;
			}
		}
	}
	return ans;
}
int main() {
	cin >> N;
	bool flag = true;
	REP(i, N * 2) {
		now[i] = N * 2;
	}
	REP(i, N) {
		cin >> A[i] >> B[i]; A[i]--; B[i]--;
		if (A[i] != -2) {
			if (now[A[i]] != N * 2) flag = false;
			now[A[i]] = i;
		}
		if (B[i] != -2) {
			if (now[B[i]] != N * 2) flag = false;
			now[B[i]] = i + N;
		}
		if (A[i] != -2 && B[i] != -2) {
			if (A[i] >= B[i]) {
				flag = false;
			}
		}
		used[i] = false;
	}
	if (flag && dfs(0, N)) cout << "Yes" << endk;
	else cout << "No" << endk;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).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 (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
const int nmax=3000005;
ll fac[nmax],finv[nmax],inv[nmax];
void COMinit(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for(int i=2;i<nmax;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}

ll com(int n,int k){
  if(n<k||n<0||k<0){
    return 0;
  }
  return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    COMinit();
    ll n,m,k;cin >> n >> m >> k;
    ll ans;
    if(n<=m+k) ans=com(n+m,m)+mod-com(n+m,m+k+1);
    else ans=0;
    ans%=mod;
    cout << ans << endl;
}

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

int main() {
  double x, y, r;
  scanf("%lf %lf %lf", &x, &y, &r);

  long long sr = static_cast<long long>(round(r * 10000)) * static_cast<long long>(round(r * 10000));
  long long ans = 0;
  for (int i = static_cast<int>(ceil(x - r)); i <= static_cast<int>(floor(x + r)); i++) {
    int lower, upper;
    long long dx = i * 10000 - static_cast<int>(round(x * 10000));
    long long sdx = 1LL * dx * dx;

    int left = static_cast<int>(floor(y - r)), right = static_cast<int>(ceil(y));
    while (left < right) {
      int mid = (left + right) >> 1;
      long long dy = mid * 10000 - static_cast<int>(round(y * 10000));
      long long sdy = 1LL * dy * dy;
      if (sdx + sdy > sr)
        left = mid + 1;
      else
        right = mid;
    }
    lower = left;

    left = static_cast<int>(floor(y)), right = static_cast<int>(ceil(y + r));
    while (left < right) {
      int mid = (left + right + 1) >> 1;
      long long dy = mid * 10000 - static_cast<int>(round(y * 10000));
      long long sdy = 1LL * dy * dy;
      if (sdx + sdy > sr)
        right = mid - 1;
      else
        left = mid;
    }
    upper = left;

    if (lower <= upper)
      ans += (upper - lower + 1);
  }

  printf("%lld\n", ans);

  return 0;
}


#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e5 + 10 ;

int a[MAX] , b[MAX] ;
int arr[MAX] ;
int n , m , q ;

vector< pair<int , int> >vp ;

multiset<int>s ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>m>>q ;
	for(int i = 0 ; i < n ; ++i)
	{
		cin>>a[i]>>b[i] ;
		vp.emplace_back(b[i] , a[i]) ;
	}
	for(int i = 0 ; i < m ; ++i)
		cin>>arr[i] ;
	sort(vp.begin() , vp.end()) ;
	reverse(vp.begin() , vp.end()) ;
	while(q--)
	{
		s.clear() ;
		int l , r ;
		cin>>l>>r ;
		l-- , r-- ;
		for(int i = 0 ; i < m ; ++i)
		{
			if(i >= l && i <= r)
				continue ;
			s.insert(arr[i]) ;
		}
		int ans = 0 ;
		for(auto &p : vp)
		{
			if(!s.size())
				break ;
			auto it = s.lower_bound(p.second) ;
			if(it == s.end())
				continue ;
			ans += p.first , s.erase(it) ;
		}
		cout<<ans<<"\n" ;
	}
	return 0 ;
}

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define ina(n,a) cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            coyhhhhhhyoc
#define next          sdNNNmNNNNNNNmds
#define y0           hNNNNy_yNNNNNN_sNh
#define y1          mNNNNNdtdNNNNNNtsNNm
#define yn          mNNNNNNNNy___smNNNms
#define tm            oooooosyysooooot
#define read               tyhyt
#define rank              ytmNmo
#define index              yyy
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
typedef long long ll;
using namespace std;

const int N = 222222;
vector<int> graph[N];
int a[N], maxi[N];
int n, m;

int solve() {
    cin >> n >> m;
    rep(u, 1, n) {
        cin >> a[u];
    }
    rep(i, 1, m) {
        int u, v;
        cin >> u >> v;
        graph[u].pb(v);
    }
    int ans = -1e9 - 19;
    rrep(u, 1, n) {
        maxi[u] = -1e9 - 19;
        rall(v, graph[u]) {
            int ne = max(maxi[v], a[v]);
            maxi[u] = max(maxi[u], ne);
        }
        ans = max(ans, maxi[u] - a[u]);
    }
    cout << ans << endl;
    return 0;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    while(t--) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define R(i,b,a) for(int i=(int)(b);i>=(int)(a);i--)
#define endl "\n"
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pii pair<int,int>
#define pb push_back
#define all(v) v.begin(),v.end()
#define I first
#define S second

const int N=105;
int n,x[N],y[N],id[N],off=1e12;

int root(int x){
   while(x!=id[x]){
      id[x]=id[id[x]];
      x=id[x];
   }
   return x;
}
void uni(int x,int y){
   int p=root(x);
   int q=root(y);
   if(p==q) return;
   id[q]=id[p];
}

bool slv(int x1,int y1,int x2,int y2,int r){
   int dis=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
   dis*=off;
   return (dis<4*r*r);
}

bool chk(int r){
   F(i,1,n+2) id[i]=i;

   F(i,1,n){
      F(j,i+1,n){
         if(slv(x[i],y[i],x[j],y[j],r)) uni(i,j);
      }
   }
   F(i,1,n){
      int d1=abs(100-y[i])*(1e6);
      int d2=abs(y[i]+100)*(1e6);

      if(d1<2*r) uni(n+1,i);
      if(d2<2*r) uni(n+2,i);
   }

   return (root(n+1)!=root(n+2));
}

int32_t main(){
   ios;
   cin>>n;

   F(i,1,n) cin>>x[i]>>y[i];

   int l=0,r=1e8,mid;
   while(l<=r){
      mid=l+r>>1;
      if(chk(mid)) l=mid+1;
      else r=mid-1;
   }
   l--;

   cout<<setprecision(9)<<double(l)/1e6<<endl;
}

#include<bits/stdc++.h>
using namespace std;
const int inf=1<<29;
const double eps=1e-8;
const int maxn=220;
int n,ans=0;
double l=0,r=100,mid=50;
int sqr(int x){return x*x;}
struct point{int x,y;}p[maxn];
struct mgset{
	int tp[maxn],siz[maxn];
	mgset(){for(int i=0;i<=n+3;i++)tp[i]=i,siz[i]=1;}
	void pre(){for(int i=0;i<=n+3;i++)tp[i]=i,siz[i]=1;}
	int get(int x){return x==tp[x]?x:tp[x]=get(tp[x]);}
	void mg(int x,int y){
		x=get(x),y=get(y);
		if(x==y)return;
		if(siz[x]<siz[y])swap(x,y);
		siz[x]+=siz[y],tp[y]=x;
	}
	bool judge(int x,int y){return get(x)==get(y);}
	int ask(int x){return siz[get(x)];}
}s;
bool check(int a,int b,double r){return sqrt(sqr(p[a].x-p[b].x)+sqr(p[a].y-p[b].y))<=r*2;}
bool judge(double r){
	s.pre();
	for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++)if(check(i,j,r))s.mg(i,j);
	for(int i=1;i<=n;i++)if(abs(p[i].y+100)<=r*2)s.mg(i,n+1);
	for(int i=1;i<=n;i++)if(abs(p[i].y-100)<=r*2)s.mg(i,n+2);
	return !s.judge(n+1,n+2);
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&p[i].x,&p[i].y);
	l=0,r=100,mid=(l+r)/2;
	while(r-l>=eps){
		mid=(l+r)/2;
		if(judge(mid))l=mid;
		else r=mid;
	}
	printf("%.4lf",l);
	return 0;
}


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

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define pii pair<int,int>
#define pdd pair<double,double>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define done(x) {cout << x << endl;return;}
#define mini(x,y) x=min(x,y)
#define maxi(x,y) x=max(x,y)
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
const int mod = 998244353;
//const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;

//DEBUG FUNCTIONS START
#define cerr cout
void __print(int x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = "; _print(x)
#else
#define deb(x...)
#endif
// DEBUG FUNCTIONS END

const int N = 3e3+5;
int dp[N][N];

void solve(){

	int n, k;
	cin>>n>>k;
	dp[0][0] = 1;

	fr(i,1,n){
		frev(j,0,n){

			if(j)
				dp[i][j] = dp[i-1][j-1];

			(dp[i][j] += (2*j>i ? 0 : dp[i][2*j]))%=mod;

		}
	}

	cout<<dp[n][k];

}

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

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

int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}

#include<bits/stdc++.h>
typedef int LL;
typedef double dl;
#define opt operator
#define pb push_back
const LL maxn=6e3+9,mod=998244353,inf=0x3f3f3f3f;
LL Read(){
	LL x(0),f(1); char c=getchar();
	while(c<'0' || c>'9'){
		if(c=='-') f=-1; c=getchar();
	}
	while(c>='0' && c<='9'){
		x=(x<<3ll)+(x<<1ll)+c-'0'; c=getchar();
	}return x*f;
}
void Chkmin(LL &x,LL y){
	if(y<x) x=y;
}
void Chkmax(LL &x,LL y){
	if(y>x) x=y;
}
LL add(LL x,LL y){
	return x+=y,x>=mod?x-mod:x;
}
LL dec(LL x,LL y){
	return x-=y,x<0?x+mod:x;
}
LL mul(LL x,LL y){
	return 1ll*x*y%mod;
}
LL Pow(LL base,LL b){
	LL ret(1); while(b){
		if(b&1) ret=mul(ret,base); base=mul(base,base); b>>=1;
	}return ret;
}
LL n,K;
LL f[maxn][maxn];
int main(){
	n=Read(); K=Read();
	if(n==1 && K==1){
		puts("1"); return 0;
	}
	for(LL i=2;i<=n;i+=2) f[0][i]=1;
	for(LL i=0;i<=n;++i){
		if(i){
		    for(LL j=1;j<=n;++j){
			    f[i][j]=add(f[i][j-1],f[i][j]);
		    }
		}
		for(LL j=0;j<=n;++j) {
			if(j&1) continue;
			if(!j) continue;
			LL x(f[i][j]);
			LL l(j/2);
			f[i+l][l]=add(f[i+l][l],x);
		}
	}
//	printf("%d\n",f[1][2]);
//	printf("%d\n",f[2][2]);
//	printf("%d\n",f[3][1]);
	printf("%d\n",f[n-K][K]);
	return 0;
	LL ret(0);
//	printf("%d\n",f[4][2]);
	for(LL i=0;i<=K;++i){
		ret=add(ret,f[n-(K-i)][K-i]);
	}
	printf("%d\n",ret);
//	printf("%d\n",f[n-K][n]);
	return 0;
}


# include <cstdio>

namespace Main {
    namespace Source {
        typedef unsigned int uint;
        static inline const uint qpow(uint b, uint e, const uint mod) {
            uint r(1);
            while (e) {
                if (e bitand 1) r = 1ull * r * b % mod;
                b = 1ull * b * b % mod, e >>= 1;
            }
            return r;
        }
    }
    using namespace Source;
    static const uint P(998244353);
    static uint n, m, k;
    static uint ans;
    static inline const void main() {
        scanf("%u%u%u", &n, &m, &k);
        if (n == 1 and m == 1) return (const void)printf("%u\n", k);
        if (n == 1) {
            for (register uint i(1); i <= k; ++i)
                ans =
                (ans + (qpow(k - i + 1, m, P) + P - qpow(k - i, m, P))) % P;
            goto end;
        }
        if (m == 1) {
            for (register uint i(1); i <= k; ++i)
                ans =
                (ans + (qpow(i, n, P) + P - qpow(i - 1, n, P))) % P;
            goto end;
        }
        for (register uint i(1); i <= k; ++i)
            ans = (ans + 1ull * (qpow(i, n, P) + P - qpow(i - 1, n, P)) * qpow(k - i + 1, m, P)) % P;
    end:printf("%u\n", ans);
    }
}

signed int main() { Main::main(); return 0; }

#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <list>
#include <unordered_set>
//#include <atcoder/convolution>
//#include <atcoder/modint>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
//using Modint = atcoder::modint998244353;
typedef long long ll;
void ex_gcd(ll a,ll b, ll& d,ll& x,ll& y){
  if(!b) {d=a;x=1;y=0;}
  else   {	ex_gcd(b,a%b,d,y,x);	y-=a/b*x;}
}
ll inv(ll a,ll n)  {
  ll d,x,y;	ex_gcd(a,n,d,x,y);
  return d==1?(x%n+n)%(n/d):-1;
}
ll gcd(ll x, ll y){
  if(y==0)return x;
  return gcd(y, x%y);
}
const int maxn = 5005;
const int mod = 998244353;

ll p[maxn];
ll cal(int x, int y){
  if(x<y)return 0;
  return p[x]*inv(p[y]*p[x-y]%mod, mod)%mod;
}

ll f[13][maxn];

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  p[0] = 1;
  for(int i=1;i<maxn;i++)p[i] = p[i-1]*i%mod;
  int n,m;
  cin>>n>>m;
  for(int i=0;i<=m;i+=2)f[0][i] = cal(n, i);
  for(int i=0;i+1<13;i++)
  for(int j=0;j<=m;j++){
    if(f[i][j]==0)continue;
    for(int k=0;j+k*(1<<(i+1))<=m;k+=2){
      f[i+1][j+k*(1<<(i+1))] = (f[i+1][j+k*(1<<(i+1))] + f[i][j]*cal(n,k)%mod)%mod;
    }
  }
  cout<<f[12][m]<<endl;
  return 0;
}


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

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr<<"hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return rng() % (y+1-x) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

using ll=long long;
using ld=long double;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
using pi=pair<ll,ll>; using spi=pair<ll,pi>; using dpi=pair<pi,pi>;

long long LLINF = 1e18;
int INF = 1e9+1e6;
#define MAXN (106)

int n, m, C[MAXN], ok[MAXN*MAXN];
pi E[MAXN*MAXN];
bitset<MAXN> vis;
vector<pi> v[MAXN];

int main() {
	FAST
	cin>>n>>m;
	FOR(i,1,m){
		cin>>E[i].f>>E[i].s;
	}
	FOR(i,1,n) cin>>C[i];
	FOR(i,1,m) {
		int a=E[i].f, b=E[i].s;
		if(C[a] > C[b]) {
			v[a].eb(b, 0), ok[i]=a;
		} else if(C[a] < C[b]) {
			v[b].eb(a, 0), ok[i]=b;
		} else {
			v[a].eb(b, i), v[b].eb(a, i);
		}
	}

	function<void(ll)>dfs=[&](ll x){
		if(vis[x]) return;
		vis[x]=1;
		for(auto i:v[x]) {
			if(i.s) {
				ok[i.s] = x;
			}
			dfs(i.f);
		}
	};
	FOR(i,1,n) dfs(i);
	FOR(i,1,m) {
		assert(ok[i]==E[i].f||ok[i]==E[i].s);
		if(ok[i] == E[i].f) cout<<"->\n";
		else cout<<"<-\n";
	}
}

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main () {
  std::ios::sync_with_stdio(false); std::cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (auto& x : a) cin >> x;
  multiset<int> have;
  set<int> st;
  for (int i = 0; i <= n; i++) st.emplace(i);
  int ans = 1 << 30;
  for (int i = 0; i < n; i++) {
    have.emplace(a[i]);
    if (st.count(a[i])) st.erase(a[i]);
    if (i - m >= 0) {
      have.erase(have.find(a[i - m]));
      if (have.find(a[i - m]) == have.end()) st.emplace(a[i - m]);
    }
    if (i >= m - 1) {
      if (!st.empty()) ans = min(ans, *st.begin());
    }
  }
  cout << ans << endl;
}


#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bits/stdc++.h>

#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

using namespace std;
using ll = long long;
using LL = long long;
using comp = complex<double>;

typedef std::pair<int, int> pii;
typedef std::pair<int, double> pid;
typedef std::vector<int> vi;
typedef std::vector<pii> vii;

const double PI = 3.14159265358979323846264338327950L;
const int mod = 1e9+7;
const ll INF = 1LL<<60;

comp inC(){
    double x,y;
    cin >> x >> y;
    return {x,y};
}

struct container {
    int bottom, top, id;
    container(int id, int bottom, int top) : top(top), bottom(bottom), id(id) {
    }
};

struct Edge {
    ll to, from, cost;
    Edge(ll to, ll from, ll cost) :to(to), from(from), cost(cost) {}
    Edge(): to(-1), from(-1), cost(0){}
};

struct Data {
    ll cost,val;
    Data(ll cost=0, ll val=0) : cost(cost), val(val){}
    bool operator<(const Data& a) const {
        return cost > a.cost;
    }
};

struct edge{
    int a,b,c;
    edge(int a = -1,int b = -1, int c = -1):a(a),b(b),c(c){}
    bool operator<(const edge& a) const {
        return c > a.c;
    }
};

void solveA(){
    ll n;
    cin >> n;

    if (n==2){
        cout << "Same" << endl;
        return;
    }

    if (n%2==1){
        cout << "Odd" << endl;
        return;
    }

    if ((n/2)%2==1){
        cout << "Same" << endl;
    }
    else cout << "Even" << endl;

}

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

    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    int m = 998244353;

    ll cursum = 0;
    ll prevadd = 0;

    ll ans = 0;
    SORT(a);

    rep(i,n){
        ll add = a[i];

        cursum *= 2LL;
        cursum += prevadd;
        cursum %= m;

        ll mult = (cursum + add)%m;

        ll p = mult*add;
        p%=m;

        ans += p;
        ans %= m;

        prevadd = add;
    }

    cout << ans;

}

int main() {
    int T = 1;
    // cin >> T;

    while (T--) {
        solve();
        // cout << endl;
    }
}

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

ll mod1= 998244353;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod1;
		}
		a=(a*a)%mod1;
		b/=2;
	}
	return res;
}

ll inv_mod(ll x){
    return pow_mod(x,mod1-2);
}
int main()
{
  int t=1;
  //cin>>t;
  while(t-->0){
      int n;
      cin>>n;
      ll a[n];
      ll sum=0;
      ll dp[n];
      dp[0]=1;
      for(int i=1;i<n;i++){
          dp[i]=2*dp[i-1];
          dp[i]%=mod1;
      }
      for(int i=0;i<n;i++){
          cin>>a[i];
          sum=(sum+(a[i]*a[i])%mod1)%mod1;
          //sum%=mod1;
      }
      sort(a,a+n);

      ll prev[n+1];
      prev[n]=0;
      for(int i=n-1;i>=1;i--){
         prev[i]=(prev[i+1]+((a[i]*a[0])%mod1*(dp[i-1]%mod1))%mod1)%mod1;
         //prev[i]%=mod1;
      }
      sum=(sum+prev[1])%mod1;

      for(int i=2;i<=n-1;i++){

          prev[i]=(prev[i]*inv_mod(dp[i-1]))%mod1;
          prev[i]=(prev[i]*inv_mod(a[0]))%mod1;
          //prev[i]/=a[0];
          prev[i]*=a[i-1];
          prev[i]%=mod1;
          sum=(sum+prev[i])%mod1;

      }
      cout<<sum;

  }
  return 0;
}


#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>

//#define ENVIRONMENT_LINKED_BOOST

#ifdef ENVIRONMENT_LINKED_BOOST
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using namespace boost::multiprecision;
#endif

using namespace std;
using uint = unsigned int;
using ll   = long long;
using ull  = unsigned long long;
#define REP(i, a, b) for (int i = a; i < b; ++i)
#define ALL(v)       v.begin(), v.end()

template <typename A, typename B>
void chmin(A &a, const B &b) {
    a = min(a, static_cast<A>(b));
};
template <typename A, typename B>
void chmax(A &a, const B &b) {
    a = max(a, static_cast<A>(b));
};

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

    ll                 smax = N * (N - 1) * K / 2;
    vector<vector<ll>> dp(N, vector<ll>(smax + 1, 0));

    dp[0][0] = 1;
    REP(i, 0, N - 1) {
        REP(j, 0, smax + 1) {
            dp[i][j] %= M;
            if (dp[i][j] == 0) continue;

            REP(k, 0, K + 1) {
                int tmp = j + (i + 1) * k;
                dp[i + 1][tmp] += dp[i][j];
            }
        }
    }
    for (ll &x : dp[N - 1]) x %= M;

    REP(i, 1, N + 1) {
        ll p   = N - i;
        ll m   = i - 1;
        ll ans = K;
        REP(j, 1, smax + 1) {
            ans += dp[p][j] * dp[m][j] % M * (K + 1) % M;
            ans %= M;
        }
        cout << ans << endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(a,b,c) for(int a=(b);a<=(c);a++)
#define per(a,b,c) for(int a=(b);a>=(c);a--)
#define pb push_back
const int N=5e5+5e4+5;
template<class T>inline void read(T &x) {
	T f=1;x=0;char s=getchar();
	while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}
	while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
	x*=f;
}
int n,k,p,f[101][N],ans,g[N],sum;
inline void solve() {
	read(n); read(k); read(p);
	f[0][0]=1;
	rep(i,1,n) {
		sum+=i*k;
		rep(j,0,sum) g[j]=(f[i-1][j]+((j>=i)?(g[j-i]):(0)))%p;
		rep(j,0,sum) f[i][j]=(p+g[j]-(((j-(k+1)*i)>=0)?(g[j-(k+1)*i]):(0)))%p;
	}
	rep(i,1,n) {
		ans=0;
		rep(sm,0,sum) (ans+=1ll*f[n-i][sm]*f[i-1][sm]%p)%=p;
		printf("%d\n",(1ll*ans*(k+1)-1)%p);
	}
}
int main() {
	//int TEST; read(TEST); while(TEST--)
	solve();
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (ll i=(ll)N-1; i>=0; i--)
#define popcount __builtin_popcount

const ll LLINF = pow(2,61)-1;
const ll INF = pow(2,30)-1;

ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }

void check(vector<ll> result) {
  ll x = 0, y = 0;
  for (auto r: result) {
    if (r==1) x++;
    else if (r==2) y++;
    else if (r==3) x+=y;
    else if (r==4) y+=x;
  }
  cout << x << endl;
}

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

  ll X = 87, tn = N;
  // ll X = 15, tn = N;
  vector<ll> fib(X); rep(i,X)  fib[i] = i<=1 ? 1 : fib[i-1] + fib[i-2];
  // debug(all(fib));
  vector<bool> used(X);

  ll top = -1;
  per(i,X) {
    if (tn>=fib[i]) {
      used[i] = true;
      tn -= fib[i];
      if (top==-1) top = i;
    }
  }
  // debug(all(used));
  // cout << top << endl;

  vector<ll> result;
  for (ll i=top; i>0; i--) {
    if (used[i]) result.push_back(i%2==0?1:2);
    result.push_back(i%2==0?4:3);
  }

  cout << result.size() << endl;
  debug(all(result));

  // check(result);
  return 0;
}

#include <iostream>

using namespace std;

typedef long long LL;

LL f[110];
int ans[150], cnt;

void ins(int x) {
    ans[cnt ++] = x;
}
int main() {
    f[0] = f[1] = 1;
    for (int i = 2; ; i ++) {
        f[i] = f[i - 1] + f[i - 2];
        if(f[i] > 1e18) {
            break;
        }
    }
    LL n, tem = 0;
    cin >> n;
    if (tem + f[86] <= n) {
        tem += f[86];
        ins(1);
    }
    for (int i = 1; i <= 86; i ++) {
        if (i & 1)  ins(4);
        else ins(3);
        if (tem + f[86 - i] <= n)  {
            tem += f[86 - i];
            if (i & 1)  ins(2);
            else ins(1);
        }
    }
    cout << cnt << endl;
    for (int i = 0; i < cnt; i ++)  cout << ans[i] << endl ;
}


#include<bits/stdc++.h>
#define R register
using namespace std;
inline int read(){
	int x=0,d=1; char y=getchar();
	while(y<'0'||y>'9'){if(y=='-')d=-1;y=getchar();}
	while(y>='0'&&y<='9'){x=(x<<3)+(x<<1)+(y^'0');y=getchar();}
	return x*d;
}
int n,k,p,l,a[10010];
int main(){
	n=read();
	while(n--){
		k=l=read();
		p=sqrt(k)+1;
		for(R int i=2;i<=l;i++)
			if(k%i==0)++a[i];
	}
	int maxn=0,id=0;
	for(R int i=2;i<=1000;i++)
		if(a[i]>maxn){
			maxn=a[i];
			id=i;
		}
	printf("%d\n",id);
	return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<stack>
#include<queue>
#include<tuple>
#include<cassert>
#include<set>
#include<bitset>
#include<functional>
#include <fstream>
//#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, x) for(ll i = 0; i < x; i++)
#define rep2(i, x) for(ll i = 1; i <= x; i++)
#define rep3(i, x, y) for(ll i = x; i < y; i++)
#define rep4(i, x) for(ll i = x; i >= 0; i--)
#define all(a) (a).begin(),(a).end()
#define puts(x) cout << (x) << "\n"
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1000000000000000000;
const int intINF = 1000000000;
const ll mod = 1000000007;
const ll MOD = 998244353;
const ld pi = 3.141592653589793238;
//const ld EPS = 1e-9;

bool isprime(int p) {
	if (p == 1) return false;
	for (int i = 2; i < p; i++) {
		if (p % i == 0) return false;
	}
	return true;
}
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(b, a % b);
}
// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
//main関数内に extGCD(a, b, x, y); でx, yに解が格納
ll extGCD(ll a, ll b, ll& x, ll& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	ll d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll keta(ll n) {
	ll res = 0;
	while (n >= 1) {
		res += n % 10; n /= 10;
	}
	return res;
}
ll modpow(ll x, ll y, ll m) {
	ll res = 1;
	while (y) {
		if (y % 2) { res *= x; res %= m; }
		x = x * x % m; y /= 2;
	}
	return res;
}
ll kaijyo[600005];
void nCkinit(ll n, ll m) {
	ll cnt = 1; kaijyo[0] = 1;
	for (int h = 1; h <= n; h++) { cnt *= h; cnt %= m; kaijyo[h] = cnt; }
}
ll nCk(ll n, ll k, ll m) {
	/*ll a = 1, b = 1;
	for (int h = 1; h <= n; h++) { a *= h; a %= m; }
	for (int h = 1; h <= k; h++) { b *= h; b %= m; }
	for (int h = 1; h <= n - k; h++) { b *= h; b %= m; }*/
	ll a = kaijyo[n], b = kaijyo[k] * kaijyo[n - k] % m;
	return a * modpow(b, m - 2, m) % m;
}
//printf("%.10f\n", n);
typedef pair <ll, ll> P;
typedef pair <char, ll> pp;
ll dx[4] = { 1, 0, -1, 0 }, dy[4] = { 0, 1, 0, -1 };
struct edge { ll to, cost; };
struct status {
	ll v;    //今の頂点
	ll cost; //今までのコスト
	ll ondo; //今の温度(0,1,2)
	ll time; //今の温度になってから何分経ったか

	bool operator<(const status& rhs) const { return cost < rhs.cost; };
	bool operator>(const status& rhs) const { return cost > rhs.cost; };
};

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

	//input
	ll n; cin >> n;
	vector<vector<ll>>a(6, vector<ll>(n));
	rep(i, n) {
		cin >> a[0][i] >> a[1][i] >> a[2][i] >> a[3][i] >> a[4][i];
	}
	vector<ll> stand(40);
	rep(k, n) {
		for (int i = 0; i < (1 << 5); i++) {
			ll cnt = INF;
			for (int j = 0; j <= 5 - 1; j++) {
				if ((i & (1 << j)) > 0) {
					cnt = min(cnt, a[j][k]);
				}
			}
			stand[i] = max(cnt, stand[i]);//cout<<i<<' '<<stand[i]<<endl;
		}
	}
	ll ok = 0, ng = mod, mid = (ok + ng) / 2;
	while (ng - ok > 1) {
		bool flag = false;
		rep(i, n) {
			for (int j = i + 1; j < n; j++) {
				ll cnt = 0;
				rep(k, 5) {
					if (max(a[k][i], a[k][j]) < mid) {
						cnt += pow(2, k);
					}
				}
				if (stand[cnt] >= mid) { flag = true; }
			}
		}
		if (flag) { ok = mid; }
		else { ng = mid; }
		mid = (ok + ng) / 2;
	}
	cout << ok << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define frfr  freopen("input.text","r",stdin); //freopen("output.text","w",stdout)
#define ll long long int
#define wh int T;cin >> T;while(T--)
#define foro(i,n) for(int i=0;i<n;i++)

void solve(){
	int n,x;
	cin >> n >> x;
	string s;
	cin >> s;
	for(int i : s){
		if(i == 'o'){
			x++;
		}else{
		   if(x != 0) x--;
		}
	}
	cout << x << endl;
}
int main()
{

	   solve();

 return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (n-1); i >= 0; i--)
#define Rep(n) for (ll _ = 0; _ < (ll)(n); _++)

template <class S>S sum(vector<S>& a) {return accumulate(all(a), S());}
template <class S>S max(vector<S>& a) {return *max_element(all(a));}
template <class S>S min(vector<S>& a) {return *min_element(all(a));}
ll max(int a, ll b) { return max((ll)a, b); } ll max(ll a, int b) { return max(a, (ll)b); }
ll min(int a, ll b) { return min((ll)a, b); } ll min(ll a, int b) { return min(a, (ll)b); }

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

void Main(){
  int n,x; cin >> n >> x;
  string s; cin >> s;
  for(char a: s){
    if(a == 'o'){
      x++;
    }else{
      x = max(0, x-1);
    }
  }
  cout << x << endl;
}