#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MODADD(ADD_X,ADD_Y)  (ADD_X+ADD_Y)%MOD
#define MODSUB(SUB_X,SUB_Y)  ((SUB_X-SUB_Y)+MOD)%MOD
#define MODMUL(MUL_X,MUL_Y)  (MUL_X*MUL_Y)%MOD
#define LCM(LCM_X,LCM_Y) (LCM_X/__gcd(LCM_X,LCM_Y))*LCM_Y
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
int dx[]= {1,0,-1,0,1,-1,1,-1};
int dy[]= {0,1,0,-1,1,-1,-1,1};
int parent[MAX+50],fam[MAX+50],ans[MAX],dep[MAX];
vector<pair<int,int> >adj[MAX];
int root(int child)
{
    while(parent[child]!=child)
    {
        parent[child]=parent[parent[child]];
        child=parent[child];
    }
    return child;
}
void node_union(int x,int y)
{
    int a=root(x);
    int b=root(y);
    parent[min(a,b)]=parent[max(a,b)];
}
void dfs(int src,int par,int h)
{
    dep[src]=h+1;
    if(ans[src]==ans[par] && par!=0)
    {
        int id=1;
        if(ans[par]==id)
            id++;
        for(auto it:adj[src])
        {
            if(it.second==id)
                id++;
        }
        ans[src]=id;
    }
    for(auto it:adj[src])
    {
        if(it.first==par)
            continue;
        ans[it.first]=it.second;
        dfs(it.first,src,h+1);
    }
}
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    for(int i=1; i<=MAX; i++)
        parent[i]=i;
    int n,m;
    cin>>n>>m;
    int cnt=0;
    for(int i=0; i<m; i++)
    {
        int a,b,c;
        cin>>a>>b>>c;
        if(root(a)!=root(b))
        {
            cnt++;
            adj[a].push_back({b,c});
            adj[b].push_back({a,c});
            node_union(a,b);
        }
    }
    if(cnt!=n-1)
    {
        cout<<"No"<<endl;
        return 0;
    }
    dfs(1,0,0);
    int id=1;
    for(auto i:adj[1])
        if(i.second==id)
            id++;
    ans[1]=id;
    for(int i=1; i<=n; i++)
        cout<<ans[i]<<endl;

    return 0;
}

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

#define mp          make_pair
#define pb          push_back
#define ff          first
#define ss          second
#define all(x)      x.begin(),x.end()
#define rall(x)     x.rbegin(),x.rend()
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b))/gcd((a),(b))
#define endl        "\n"
#define pi          3.14159265358979323846
#define inf         1000000000
#define setbits(x)  __builtin_popcountll(x)
#define ll          long long
#define int         long long
#define ld          long double
#define lb          lower_bound
#define ub          upper_bound

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int N = 2e5+50;
const ll INF = 1e9;

// int dx[9]={-1,-1,-1,0,1,1,1,0,0};
// int dy[9]={-1,0,1,1,1,0,-1,-1,0};
int dx[] = {-1,0,1,0};
int dy[] = {0,1,0,-1};

//only for prime m

template<typename T>
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float 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 debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
const int mod = 1e9 + 7;

bool compare(const pair<ll, ll>&i, const pair<ll, ll>&j){ return i.second < j.second; }
ll modexp(ll x,ll n){ ll r=1; while(n){ if(n&1)r=(r*x)%mod; x=(x*x)%mod; n>>=1;} return r%mod;}
ll modinv(ll x){ return modexp(x,mod-2);}
// ll ncr(ll n,ll r){ if(n<r) return 0; ll ans=(fact[n]%mod * modinv(fact[r])%mod * modinv(fact[n-r])%mod)%mod; return ans;}
vector<ll>sieve(int n){int*arr=new int[n + 1](); vector<ll>vect; for(int i=2;i<=n;i++) if(arr[i]==0) {vect.push_back(i); for (int j=2*i;j<=n;j+=i) arr[j]=1;} return vect;}

ll mod_add(ll a,ll b){a=a%mod; b=b%mod; return (((a+b)%mod)+mod)%mod;}
ll mod_mul(ll a,ll b){a=a%mod; b=b%mod; return (((a*b)%mod)+mod)%mod;}
ll mod_sub(ll a,ll b){a=a%mod; b=b%mod; return (((a-b)%mod)+mod)%mod;}
ll mod_div(ll a,ll b){a=a%mod; b=b%mod; return (mod_mul(a,modinv(b))+mod)%mod;}

int n,m;
vector<int>adj[2005];
vector<pair<int,int>>ans;
int vis[2005];

void dfs(int x,int par){
    ans.pb(mp(x,par));
    vis[x]=1;
    for(auto ch:adj[x]){
        if(ch!=par and !vis[ch]){
            dfs(ch,x);
        }
    }
}

void solve(){
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        adj[a].pb(b);
    }

    for(int i=1;i<=n;i++){
        memset(vis,0,sizeof(vis));
        dfs(i,i);
    }
    debug(ans);
    cout<<ans.size()<<endl;
    return ;

}

int32_t main()
{
    fio
    // #ifdef ONLINE_JUDGE
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    // #endif

    // pre();
    int t=1;
    // cin>>t;
    for(int i=0;i<t;i++)
    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define gc getchar() //(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define IT iterator
#define V vector
#define TP template <class o>
#define TPP template <typename t1, typename t2>
#define SZ(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define REP(i, a, b) for (int i = b; i >= a; i--)
#define FOR(i, n) rep(i, 1, n)
#define debug(x) cerr << #x << ' ' << '=' << ' ' << x << endl
using namespace std;
typedef double db;
typedef unsigned ui;
typedef long long ll;
typedef long double ld;

// char buf[1 << 20],*p1=buf,*p2=buf;
TP void qr(o& x) {
    char c = gc;
    x = 0;
    int f = 1;
    while (!isdigit(c)) {
        if (c == '-')
            f = -1;
        c = gc;
    }
    while (isdigit(c))
        x = x * 10 + c - '0', c = gc;
    x *= f;
}
template <class o, class... O> void qr(o& x, O&... y) { qr(x), qr(y...); }
TP void qw(o x) {
    if (x < 0)
        putchar('-'), x = -x;
    if (x / 10)
        qw(x / 10);
    putchar(x % 10 + '0');
}
TP void pr1(o x) { qw(x), putchar(' '); }
template <class o, class... O> void pr1(o x, O... y) { pr1(x), pr1(y...); }
TP void pr2(o x) { qw(x), putchar(10); }
template <class o, class... O> void pr2(o x, O... y) { pr2(x), pr2(y...); }
TP bool cmax(o& x, o y) { return (x < y ? x = y, 1 : 0); }
TP bool cmin(o& x, o y) { return (x > y ? x = y, 1 : 0); }

const int mod = (int)1e9 + 7;
TPP void ad(t1& x, t2 y) { (x += y) >= mod && (x -= mod); }
TPP void dl(t1& x, t2 y) { (x -= y) < 0 && (x += mod); }

ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll power(ll a, ll b = mod - 2, ll p = mod) {
    ll c = 1;
    while (b) {
        if (b & 1)
            c = c * a % p;
        b /= 2;
        a = a * a % p;
    }
    return c;
}
ll exgcd(ll a, ll b, ll& x, ll& y) {
    if (!a) {
        x = 0;
        y = 1;
        return b;
    }
    ll d = exgcd(b % a, a, y, x);
    x -= b / a * y;
    return d;
}
ll INV(ll n, ll p = mod) {
    ll x, y;
    exgcd(n, p, x, y);
    return (x % p + p) % p;
}

const int N = 110;
const ll INF = 1e15;
int n, m, k, val[N];

struct rec {
    int a[N][N];
    rec() { memset(a, 0, sizeof a); }
    rec operator*(rec b) const {
        rec c;
        FOR(i, n) FOR(j, n) FOR(k, n) ad(c.a[i][k], 1ll * a[i][j] * b.a[j][k] % mod);
        return c;
    }
} a, c;

void solve() {
    qr(n, m, k);
    FOR(i, n) a.a[i][i] = c.a[i][i] = 1, qr(val[i]);
    ll inv = power(2 * m);
    while (m--) {
        int x, y;
        qr(x, y);
        dl(a.a[x][x], inv);
        ad(a.a[x][y], inv);
        dl(a.a[y][y], inv);
        ad(a.a[y][x], inv);
    }
    while (k) {
        if (k & 1)
            c = c * a;
        k /= 2;
        a = a * a;
    }
    FOR(i, n) {
        ll ans = 0;
        FOR(j, n) ad(ans, 1ll * c.a[j][i] * val[j] % mod);
        pr2(ans);
    }
}

int main() {
#ifndef ONLINE_JUDGE
    clock_t start_time = clock();
#endif
    int T = 1;
    // qr(T);
    while (T--)
        solve();
#ifndef ONLINE_JUDGE
    cerr << 1.0 * (clock() - start_time) / CLOCKS_PER_SEC << ' ' << 's' << endl;
#endif
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define rrep(i, n) for(long long i = (long long)(n - 1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using ll = long long;
using ull = unsigned long long;

int main()
{
	char a, b, c;
	cin >> a >> b >> c;

	cout << b << c << a << endl;

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
     int n,i,a[1001],sum=0;
    cin >> n;
    for(i=0;i<n;i++)
    {
      cin >> a[i];
}
    for(i=0;i<n;i++)
    {
    if(a[i]>10)
        {

       sum+=a[i]-10;
            }
    }
    cout << sum;
     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() {
	ll n;
	cin >> n;
	VL v(n);
	cin >> v;
	ll ans = 0;
	REPC(x, v) {
		ans += std::max(0LL, x - 10);
	}
	cout << ans << endl;
}


#include<bits/stdc++.h>
#define inf INT_MAX
#define sc(a) scanf("%d",&a)
#define scc(a,b) scanf("%d %d",&a,&b)
#define sccc(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define lsc(a) scanf("%lld",&a)
#define lscc(a,b) scanf("%lld %lld",&a,&b)
#define lsccc(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define pf(a) printf("%d",a)
#define pff(a,b) printf("%d %d",a,b)
#define pfff(a,b,c) printf("%d %d %d",a,b,c)
#define pb(a) push_back(a)
#define em empty()
#define fr front()
#define cl clear()
#define sz size()
#define mp(a,b) make_pair(a,b)
#define fri(b) freopen(b,"r",stdin)
#define fro(b) freopen(b,"w",stdout)

using namespace std;

vector<string> vec;
long long arr[64];

int main(){
	//fri("gir.txt");
	//fro("cik.txt");
	int n;
	cin>>n;
	long long add=1;
	arr[0]=add;
	for(int i=1;i<=60;i++){
		add*=2;
		arr[i]=add;
	}
	string sss="aaa";
	vec.pb(sss);
	long long cnt=0;
	for(int i=1;i<=n;i++){
		string asd;
		cin>>asd;
		vec.pb(asd);
		if(asd=="OR"){
			cnt+=arr[i];
		}
	}
	cnt++;
	cout<<cnt<<endl;

	return 0;
}

#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define LLI long long int
#define REP(i, n) for(LLI i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(LLI i = s, i##_l = (e); i < i##_l; i++)
#define _min(a,b) ((a<b)?a:b)
#define _max(a,b) ((a<b)?b:a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a)?1:-1)
#define SORT(v) sort(v.begin(),v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

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

	LLI n;
	cin >> n;

	vector<LLI> a(n), b(n);
	LLI am = 1, bm = 1, amt = 1;
	LLI ma = 1;
	REP(i, n)
	{
		cin >> a[i];
	}
	REP(i, n)
	{
		cin >> b[i];
	}

	REP(i, n)
	{
		chmax(ma, b[i] * am);
		chmax(am, a[i]);
		chmax(ma, b[i] * am);
		cout << ma << endl;
	}

	return 0;
}


/*Jai Shree Ram*/
// Never Give Up
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii            unordered_map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define F(i,s,e,j)        for(int i=s;i<=e;i+=j)
#define mt19937                 rng(chrono::steady_clock::now().tjhe_since_epoch().count());
//shuffle(arr,arr+n,rng)
#define ld long double
 void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int dp[1<<19];
vector<pii> queries[101];
int cnt[19];
int solve(int bits,int n)
{
  if(dp[bits]!=-1)
  	return dp[bits];
  int num = setbits(bits);
  cnt[0] = 0;
  for(int i=1;i<=n;i++)
  {
     cnt[i] = cnt[i-1];
     if(bits&(1<<i))
     	cnt[i]++;
  }
  dp[bits] = 0;
  for(pii q:queries[num])
  {
     if(cnt[q.ff]>q.ss)
     	return 0;
  }
  if(num==n)
  	return dp[bits] = 1;
  for(int i=1;i<=n;i++)
  {
  	if((bits&(1<<i))==0)
  	{
  		dp[bits] += solve(bits|(1<<i),n);
  	}
  }
  return dp[bits];
}
int32_t main()
{   c_p_c();
     int n,m;
     cin>>n>>m;
     for(int i=0;i<m;i++)
     {
     	int x,y,z;
     	cin>>x;
        cin>>y>>z;
        queries[x].pb(mp(y,z));
     }
     memset(dp,-1,sizeof(dp));
     cout<<solve(0,n)<<endl;
}

// generated by oj-template v4.7.2 (https://github.com/online-judge-tools/template-generator)
#include <bits/stdc++.h>
#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()

using namespace std;
using i64 = long long int;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    constexpr char endl = '\n';
    i64 N, M;
    cin >> N >> M;
    vector<i64> X(M), Y(M), Z(M);
    rep(i, M) cin >> X[i] >> Y[i] >> Z[i];
    vector<i64> dp(1LL<<N);
    dp[0] = 1;
    rep(i, 1LL<<N){
        i64 x = __builtin_popcount(i);
        vector<i64> c(N + 1);
        rep(k, N){
            if((i & (1LL<<k)) != 0) c[k] += 1;
            if(k != 0) c[k] += c[k - 1];
        }
        rep(k, N){
            if((i & (1LL<<k)) != 0) continue;
            rep(l, N) if(l >= k) c[l]++;
            bool flag = true;
            rep(j, M){
                if(X[j] == x + 1){
                    if(c[Y[j] - 1] > Z[j]) flag = false;
                }
            }
            if(flag) dp[i | (1LL<<k)] += dp[i];
            rep(l, N) if(l >= k) c[l]--;
        }
    }
    cout << dp[(1LL<<N) - 1] << endl;
}


#include <iostream>

using namespace std;
int main(){
  char a,b,c;
  cin >> a >> b >> c;
  if(a == b && b == c) cout << "Won" << endl;
  else cout << "Lost" << endl;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using cd = complex<double>;
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LB lower_bound
#define UB upper_bound
#define sz(a) int((a).size())
#define REP(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define REPD(i, a, b) for (int i = (int)a - 1; i >= (int)b; i--)
#define VREP(it, v) for (auto it = v.begin(); it != v.end(); it++)
typedef pair<ll,ll> pi;
typedef vector<ll> vi;

const ll MOD = 1000000009;
const double PI = acos(-1);

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

template <typename K, typename V>
using pbds_map = tree<K, V, less<K>, rb_tree_tag, tree_order_statistics_node_update>;
char a, b, c;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> a >> b >> c;
	if (a == b && b == c) cout << "Won" << endl;
	else cout << "Lost" << endl;
}

//cout.flush()
//cout << fixed << setprecision(9) << x << endl;


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

signed main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int arr[4]={a,b,c,d};
  sort(arr,arr+4);
  // maxi=arr[3];
  if(arr[3]==arr[0]+arr[1]+arr[2]){
    cout<<"Yes";
  }
  else if(arr[3]+arr[0]==arr[1]+arr[2]){
    cout<<"Yes";
  }
  else if(arr[3]+arr[0]+arr[1]==arr[2]){
    cout<<"Yes";
  }
  else {
    cout<<"No";
  }

}

#include <bits/stdc++.h>
#include <math.h>
#include <chrono>
using namespace std;
#pragma GCC optimize("-O3")
#define endl "\n"
#define mp make_pair
#define st first
#define nd second
#define pii pair<int, int>
#define pb push_back
#define _upgrade ios_base::sync_with_stdio(0), cout.setf(ios::fixed), cout.precision(10), cin.tie(0), cout.tie(0);
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FWD(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define fwd(i, a, b) for (int i = (a); i < (b); ++i)
#define all(c) (c).begin(), (c).end()
#define sz(X) (int)((X).size())
#define what(x) cerr << #x << " is " << x << endl;

ostream &operator<<(ostream &out, string str)
{
    for (char c : str)
        out << c;
    return out;
}
template <class L, class R>
ostream &operator<<(ostream &out, pair<L, R> p)
{
    return out << "(" << p.st << ", " << p.nd << ")";
}
template <class T>
auto operator<<(ostream &out, T a) -> decltype(a.begin(), out)
{
    out << '{';
    for (auto it = a.begin(); it != a.end(); it = next(it))
        out << (it != a.begin() ? ", " : "") << *it;
    return out << '}';
}
void dump() { cerr << "\n"; }
template <class T, class... Ts>
void dump(T a, Ts... x)
{
    cerr << a << ", ";
    dump(x...);
}
#define debug(...) cerr << "[" #__VA_ARGS__ "]: ", dump(__VA_ARGS__)

const int MAXN = 4;

int32_t main()
{
    _upgrade;
    vector<int> X(MAXN);

    rep(i, MAXN) cin >> X[i];
    int sum = accumulate(all(X), 0);

    rep(S, 1 << MAXN)
    {
        int s = 0;
        rep(i, MAXN) if (S & (1 << i))
            s += X[i];
        // debug(s, sum);
        if (2 * s == sum)
        {
            cout << "Yes" << endl;
            exit(0);
        }
    }
    cout << "No\n";
}


#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 chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))
#define FOR(i,x,n) for(int i=x;i<(n);i++)

using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vc = vector<char>;
using vvc = vector<vc>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vll = vector<ll>;
using vvll = vector<vll>;
using Graph = vector<vector<int>>;
ll INF = 10000000000;
int main()
{
  ll N;
  cin >> N;
  vvll C(N,vll(N));
  ll MIN_h = INF, MIN_w = INF,MIN = INF;
  rep(i,N)
  {
    rep(j,N)
    {
      cin >> C[i][j];
      if(MIN>C[i][j])
      {
        chmin(MIN, C[i][j]);
        MIN_h = i;
        MIN_w = j;
      }
    }
  }
  bool check = true;
  vll mem(N);
  ll temp1 = INF;
  rep(i,N)
  {
    chmin(temp1, C[0][i]);
  }
  rep(i,N)
  {
    mem[i] = C[0][i] - temp1;
  }
  rep(i,N)
  {
    rep(j,N-1)
    {
      if(C[i][j+1]!=C[i][j]+mem[j+1]-mem[j])
        check = false;
    }
  }
  vvll ans(N, vll(N));
  if(check)
  {
    cout << "Yes" << endl;
    vll A(N), B(N);
    rep(i,N)
    {
      A[i] = C[i][MIN_w] - MIN;
    }
    rep(i,N)
    {
      B[i] = C[MIN_h][i];
    }
    rep(i,N)
    {
      cout << A[i];
      if(i!=N-1)
        cout << " ";
    }
    cout << endl;
    rep(i, N)
    {
      cout << B[i];
      if (i != N - 1)
        cout << " ";
    }
    cout << endl;
  }
  else
  {
    cout << "No" << endl;
  }

}

#include <bits/stdc++.h>
using namespace std;
const int N=510;
int a[N],c[N][N],d[N][N];
int main()
{
	int n;
	cin>>n;
	memset(a,0x3f,sizeof(a));
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
		{
			cin>>c[i][j];
			a[i]=min(a[i],c[i][j]);
			d[i][j]=c[i][j]-c[i][1];
		}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(d[i][j]!=d[1][j])
			{
				puts("No");
				return 0;
			}
	puts("Yes");
	for(int i=1;i<=n;i++) cout<<a[i]<<' ';
	puts("");
	for(int i=1;i<=n;i++) cout<<c[1][i]-a[1]<<' ';
    return 0;
}


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

using ull = unsigned long long;
using ll = long long;
using ld = long double;

const int mod = 998244353;
const double pi = acos(-1.0);
const int inf = INT_MAX;

template<const int M>
struct ModInt {
	int val;
	ModInt(): val(-1) {}
	ModInt(ll x) : val(x % M) { if (val < 0) { val += M; }}
	ModInt pow(ll n) const { ModInt ans = 1, x = val; while (n) { if (n & 1) ans *= x; x *= x; n /= 2; } return ans; }
	ModInt inv() const { return pow(M - 2); }

	ModInt operator- () const { return M - val; }
	ModInt operator+ (ModInt m) const { m.val += val; if (m.val >= M) m.val -= M; return m; }
	ModInt operator- (ModInt m) const { m.val = val - m.val; if (m.val < 0) m.val += M; return m; }
	ModInt operator* (ModInt m) const { m.val = m.val * (ll) val % M; return m; }
	ModInt operator/ (ModInt m) const { return *this * m.inv(); }
	ModInt operator+=(ModInt m) { return *this = *this + m; }
	ModInt operator-=(ModInt m) { return *this = *this - m; }
	ModInt operator*=(ModInt m) { return *this = *this * m; }
	ModInt operator/=(ModInt m) { return *this = *this / m; }

	friend ModInt operator+(int lhs, ModInt m) { return ModInt(lhs) + m; }
	friend ModInt operator-(int lhs, ModInt m) { return ModInt(lhs) - m; }
	friend ModInt operator*(int lhs, ModInt m) { return ModInt(lhs) * m; }
	friend ModInt operator/(int lhs, ModInt m) { return ModInt(lhs) / m; }
	friend ModInt operator+(ll  lhs, ModInt m) { return ModInt(lhs) + m; }
	friend ModInt operator-(ll  lhs, ModInt m) { return ModInt(lhs) - m; }
	friend ModInt operator*(ll  lhs, ModInt m) { return ModInt(lhs) * m; }
	friend ModInt operator/(ll  lhs, ModInt m) { return ModInt(lhs) / m; }

	friend ostream &operator<<(ostream &os, const ModInt &m) {
		os << m.val;
		return os;
	}
	friend istream &operator>>(istream &is, ModInt &m) {
		ll x; is >> x; m = x;
		return is;
	}
};

using mint = ModInt<mod>;
const int N = 3000 + 5;

mint dp[N][N];

mint recurse(int n, int k) {
	if (n == 0 && k == 0) {
		return 1;
	}
	if (n == 0 || k == 0 || k > n) {
		return 0;
	}
	if (dp[n][k].val != -1) {
		return dp[n][k];
	}
	return dp[n][k] = recurse(n - 1, k - 1) + recurse(n, k << 1);
}

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

	int n, k;
	cin >> n >> k;
	cout << recurse(n, k) << '\n';
	return 0;
}

#include <stdio.h>
#include <bits/stdc++.h>
#define ll long long int
#define inf 1000000000000
#define mod 998244353
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define ps(x, y) fixed << setprecision(y) << x
using namespace std;

void solve()
{
	ll n, kl;
	cin >> n >> kl;
	vector<vector<ll>> dp(n + 1, vector<ll>(n + 1, 0));
	dp[1][1] = 1;
	for(int i=2;i<=n;i++)
	{
		for(int k=i;k>=1;k--)
		{
			dp[i][k] = (dp[i][k] + dp[i - 1][k - 1] + (2 * k <= i ? dp[i][2 * k] : 0)) % mod;
		}
	}
	cout << dp[n][kl] << endl;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	int t = 1;
	// cin>>t;
	while (t--)
	{
		solve();
	}
}


#include <cmath>
#include <vector>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <set>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <climits>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <memory>
#include <functional>
#include <cfloat>
#include <numeric>
#include <random>
#include <sstream>
#include <bitset>
#include <complex>
#include <chrono>
#include <cassert>
#include <chrono>

constexpr int MOD = 1000000007;
long long int power(long long int base, int exp) {
	long long int result{ 1 };
	while (exp > 0) {
		if (exp & 1) {
			result = (result * base) % MOD;
		}
		exp >>= 1;
		base = (base * base) % MOD;
	}
	return result;
}
long long int combination(const int n, const int r) {
	long long int result{ 1 };
	for (auto i = 0; i < r; ++i) {
		result = (result * (n - i)) % MOD;
	}
	for (auto i = 1; i <= r; ++i) {
		result = result * power(i, MOD - 2) % MOD;
	}
	return result;
}
int main() {
	int n, m; std::cin >> n >> m;
	std::vector<int> series(n);
	for (auto& a : series) std::cin >> a;
	const auto sum = std::accumulate(series.begin(), series.end(), 0);
	if (sum > m) {
		std::cout << "0\n";
		return 0;
	}
	std::cout << combination(n + m, sum + n) << '\n';
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#pragma GCC optimize ("-O3")
#define int long long
#define ld long double
#define endl "\n"

#define rep(i,begin,end) for (__typeof(end) i=begin-(begin>end); i!=(end)-(begin>end); i+=1-2*(begin>end))
#define umap unordered_map
#define pq priority_queue
#define pb push_back
#define mp make_pair
#define fs first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define mii map<int,int>
#define pii pair<int,int>
#define vc vector
#define vi vc<int>
#define vvi vc<vi>
#define all(v) v.begin(),v.end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define w(t) int t; cin>>t; rep(tc,0,t)
#define clr(a,x) memset(a,x,sizeof a)

#define chkbit(x,i) ((x)&(1LL<<(i)))
#define setbit(x,i) ((x)|(1LL<<(i)))
#define setbits(x)  __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define print(a, n) rep(i,0,n) cout<<a[i]<<" "; cout<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int mod = 1e9+7;
const int mod2 = 998244353;
const int N = 2e6;
const int inf = 1e18;
const ld PI = 3.141592653589793;

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

template<typename... T>
void in(T&... args) {((cin>>args), ...);}
template<typename... T>
void out(T&&... args) {((cout<<args<<" "), ...);}
template<typename... T>
void outln(T&&... args) {((cout<<args<<" "), ...); cout<<endl;}

int nxt(){int x;cin>>x;return x;}
int add(int a,int b,int mod){int res=(a+b)%mod;return (res<0)?res+mod:res;}
int mul(int a,int b,int mod){int res=(a*1LL*b)%mod;return (res<0)?res+mod:res;}
int range(int x,int y,int z) {return (x >= y && x <= z);}

struct customCompare {
    bool operator () (int x, int y) {
        return x>y;
    }
};

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

int n, m;

int ModExp(int x, int y, int m){
    int res = 1;
    while (y > 0) {
        if (y & 1) res = (res*x) % m;
        y = y>>1;
        x = (x*x) % m;
    }
    return res;
}

int ModInverse(int a, int m) {
    return ModExp(a, m-2, m);
}

int fun (int n, int k) {
    int ans = 0;
    if (k <= n) {
        if (k > n-k) k = n-k;

        ans = 1;
        rep (i, 1, k+1) {
            ans = (ans * ModInverse(i, mod)) % mod;
            ans = (ans * (n - i + 1)) % mod;
        }
    }

    return ans;
}

void solve() {
    int n = nxt();
    int m = nxt();

    int sum = 0;
    rep (i, 0, n) {
        sum += nxt();
    }

    cout << fun(m+n, sum+n);
}

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

    solve();
    return 0;
}


#include <bits/stdc++.h>

#define Mod 998244353

using namespace std;

typedef long long ll;

inline int read() {
	int out = 0;
	bool flag = false;
	register char cc = getchar();
	while (cc < '0' || cc > '9') {
		if (cc == '-') flag = true;
		cc = getchar();
	}
	while (cc >= '0' && cc <= '9') {
		out = (out << 3) + (out << 1) + (cc ^ 48);
		cc = getchar();
	}
	return flag ? -out : out;
}

inline void write(ll x, char ch) {
	if (x < 0) putchar('-'), x = -x;
	if (x == 0) putchar('0');
	else {
		int num = 0;
		char cc[22];
		while (x) cc[++num] = x % 10 + 48, x /= 10;
		while (num) putchar(cc[num--]);
	}
	putchar(ch);
}

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

const int N = 2e5 + 10;

int n, a[N];

long long pre, Max, ans;

int main() {
	n = read();
	for (int i = 1; i <= n; i++) a[i] = read();
	for (int i = 1; i <= n; i++) {
		pre += a[i];
		long long las = Max; Max = max(Max, (ll)a[i]);
		ans += pre, ans = ans - las * (i - 1ll) + Max * i;
		write(ans, '\n');
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define fo(i,a,n) for(i=a;i<n;i++)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define sortrev(x) sort(all(x),greater<int>())
#define pi 3.1415926535897932384626

typedef pair<int,int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll>  vl;
typedef vector<pii> vpii;
typedef vector<pl>  vpl;
typedef vector<vi>  vvi;
typedef vector<vl>  vvl;
typedef vector<double> vd;

const int mod = 1000000007;
const int inf = 1000000000;
const int N = 100007, M = N;
ll i,j,cnt,par;

void solve() {
	int n;
	cin>>n;
	cout<<(100 - n%100) <<"\n";
}

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

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

    return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<pair<int,int>> A(2*N);
  for(int i=0;i<2*N;i++){
    int a;
    cin >> a;
    A[i] = make_pair(a,i);
  }
  sort(A.begin(),A.end());
  vector<int> c(2*N);
  for(int i=0;i<N;i++) c[A[i].second] = 1;
  for(int i=0;i<N;i++) c[A[N+i].second] = 2;
  vector<pair<int,int>> s(0);
  vector<char> ans(2*N);
  for(int i=0;i<2*N;i++){
    if(s.size() == 0) s.push_back(make_pair(c[i],i));
    else if(s.back().first == c[i]) s.push_back(make_pair(c[i],i));
    else{
      int a = s.back().second;
      int b = i;
      if(a > b) swap(a,b);
      s.pop_back();
      ans[a] = '(';
      ans[b] = ')';
    }
  }
  for(int i=0;i<2*N;i++) cout << ans[i];
  cout << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
#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 per(i,n) for(int i=int(n)-1;i>=0;i--)
#define per1(i,n) for(int i=int(n);i>0;i--)
#define all(c) c.begin(),c.end()
#define si(x) int(x.size())
#define pb emplace_back
#define fs first
#define sc second
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
template<class T,class U> void chmax(T& x, U y){if(x<y) x=y;}
template<class T,class U> void chmin(T& x, U y){if(y<x) x=y;}
template<class T> void mkuni(V<T>& v){sort(all(v));v.erase(unique(all(v)),v.end());}
template<class T> int lwb(const V<T>& v, const T& a){return lower_bound(all(v),a) - v.begin();}
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
void dmpr(ostream& os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ~ ";
	dmpr(os,args...);
}
#define shows(...) cerr << "LINE" << __LINE__ << " : ";dmpr(cerr,##__VA_ARGS__)
#define dump(x) cerr << "LINE" << __LINE__ << " : " << #x << " = {";  \
	for(auto v: x) cerr << v << ","; cerr << "}" << endl;
#else
#define show(x) void(0)
#define dump(x) void(0)
#define shows(...) void(0)
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);

	int N; cin >> N;
	V<double> A(N); rep(i,N) cin >> A[i];
	auto f = [&](double x){
		double res = 0;
		rep(i,N) res += x + A[i] - min(A[i],x+x);
		return res;
	};
	double lb = 0, ub = 1e9;
	rep(t,120){
		double ma = (lb+lb+ub)/3, mb = (lb+ub+ub)/3;
		if(f(ma) < f(mb)) ub = mb;
		else lb = ma;
	}
	show(lb);
	cout << f(lb)/N << endl;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  string S, T;
  cin >> S >> T;
  int sc = 0, tc = 0;
  vector<int> P(N + 1, N - 1);
  for (int i = N - 1; i > -1; i--) {
    if (S[i] == '1') {
      P[i] = i;
      sc++;
    } else if (S[i] == '0') {
      P[i] = P[i + 1];
    }
    if (T[i] == '1') tc++;
    if (sc < tc) {
      cout << -1 << '\n';
      return 0;
    }
  }
  if (sc < tc || (sc > tc && (sc - tc) % 2 != 0)) {
    cout << -1 << '\n';
    return 0;
  }
  int pos = P.front();
  int64_t res = 0;
  for (int i = 0; i < N; i++) {
    if (T[i] == '1') {
      int j = pos;
      S[j] = '0';
      res += j - i;
      pos = P[j + 1];
    } else if (S[i] == '1') {
      int j = P[i + 1];
      S[i] = '0';
      S[j] = '0';
      res += j - i;
      pos = P[P[j + 1]];
    }
  }
  cout << res << '\n';
  return 0;
}

//  “Alhamdulillah for Everything”
#include<bits/stdc++.h>
using namespace std;

#define      pai              acos(-1)
#define      ff               first
#define      ss               second
#define      ll               long long
#define      pb               push_back
#define      mp               make_pair
#define      pll              pair<ll,ll>
#define      sz(a)            (ll)a.size()
#define      endl             "\n"
#define      gcd(a, b)        __gcd(a, b)
#define      lcm(a, b)        ((a*b)/gcd(a,b))
#define      all(vec)         vec.begin(),vec.end()
#define      ms(a, b)         memset(a,b,sizeof(a))
#define      rep(i,b,n)       for(ll i = b;i <= n; i++)
#define      rev(i,b,n)       for(ll i = b;i >= n; i--)
#define      watch(x)         cout<<(#x)<<" = "<<(x)<<'\n'
#define      TEST_CASE(t)     for(ll zz=1;zz<=t;zz++)
#define      PRINT_CASE       cout<<"Case "<<zz<<": ";
#define      fii              freopen("input.txt","r",stdin);
#define      foo              freopen("output.txt","w",stdout);
#define      boom             ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

const ll mod = 1e9+7;
const ll mxn = 1e5+7;
const ll inf = 1e18;

ll sumd(ll a,ll b){return (((a%mod)+(b%mod))%mod);}
ll muld(ll a,ll b){return (((a%mod)*(b%mod))%mod);}
ll subd(ll a,ll b){return (((a%mod)-(b%mod)+mod)%mod);}

int  main()
{
    boom;
    double a,b,c,d,n,m,x,y,z;
    cin>>a>>b>>c;
    d = b/a;
    n = ceil(d*c);
    for(ll i=n;i>=0;i--)
    {
        m = i/c;
        if(m<d)
        {
            cout<<i<<endl;
            return 0;
        }
    }
    return 0;
}


#include <stdio.h>
#include <assert.h>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <vector>
#include <numeric>
#include <iomanip>
#define ll long long
#define mint modint<MOD>
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tpiii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector
#define vi vec<int>
#define vmi vec<mint>
#define vl vec<ll>
#define vvi vec<vi>
#define vvl vec<vl>
#define vpii vec<pii>
#define vpll vec<pll>
#define vbl vec<bool>
#define endl "\n"
#define all(c) (c).begin(),(c).end()
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}
char chin(){char c;cin>>c;return c;}
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;}
template<class T> inline void print(pair<T,T> p){cout<<"("<<p.first<<","<<p.second<<") ";}
template<class T> inline void print(T v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void drop(string s){cout<<s<<endl; exit(0);}
void drop(int x){cout<<x<<endl; exit(0);}
void drop(ll x){cout<<x<<endl; exit(0);}
void drop(double x){cout<<x<<endl; exit(0);}

int n;
vi p,x;
vvi ans;

bool f(int k,int q){ //k回目
    if(k==n-1){
        return (p[n-1]==0) ^ (q!=0 && q!=x[n-1]);
    }
    if(ans[k+1][q*10%7] < 0) ans[k+1][q*10%7] = f(k+1,q*10%7);
    if(ans[k+1][(q*10+x[k+1])%7] < 0) ans[k+1][(q*10+x[k+1])%7] = f(k+1, (q*10+x[k+1])%7);
    if(p[k] == 0){
        return ans[k+1][q*10%7] || ans[k+1][(q*10+x[k+1])%7];
    }else{
        return !(ans[k+1][(q*10+x[k+1])%7]  && ans[k+1][(q*10+x[k+1])%7]);
    }
}

int main(){
    n=in();
    string s=stin();
    x.resize(n);
    rep(i,n)x[i] = (s[i]-'0')%7;
    s=stin();
    p.resize(n);
    rep(i,n)p[i]=s[i]=='T' ? 1:0; // 1 -> T, 0 -> A
    vi m(n);
    m[n-1]=1;
    rep3(k,n-2,0)m[k] = m[k+1] * 10 % 7;

    ans.resize(n,vi(7,-1));
    rep(q,7){
        if(p[n-1] == 1){
            ans[n-1][q] =  q==0 || q==x[n-1];
        }else{
            ans[n-1][q] =  q == 0 && q==x[n-1];
        }
    }
    rep3(k,n-2,0){
        rep(q,7){
            if(p[k] == 1){
                ans[k][q] =  ans[k+1][q] || ans[k+1][((q - x[k]*m[k])%7+7)%7];
            }else{
                ans[k][q] =  ans[k+1][q]  && ans[k+1][((q - x[k]*m[k])%7+7)%7];
            }
        }
    }
    if(ans[0][0])drop("Takahashi");
    else drop("Aoki");
}

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

const ll INF=1e15;

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

  int N,M;
  cin>>N>>M;
  vector<ll> W(N);
  rep(i,N) cin>>W[i];
  vector<ll> L(M),V(M);
  rep(i,M) cin>>L[i]>>V[i];

  {
    ll mi=*min_element(all(V));
    ll ma=*max_element(all(W));
    if(mi<ma){
      cout<<"-1"<<"\n";
      return 0;
    }
  }

  vector<ll> v=L;
  sort(all(v));
  v.erase(unique(all(v)),v.end());
  int P=v.size();
  map<ll,int> mp;
  rep(i,P) mp[v[i]]=i;

  vector<ll> dp(P+1,INF);
  rep(i,M) chmin(dp[mp[L[i]]],V[i]);
  for(int i=P-1;i>=0;i--) chmin(dp[i],dp[i+1]);

  ll MA=*max_element(all(L));
  vector<int> ord(N,0);
  rep(i,N) ord[i]=i;
  ll ans=INF;
  do{
    vector<ll> dist;
    vector<ll> sum;
    sum.push_back(0);
    for(int i=0;i<N;i++){
      int now=ord[i];
      ll ok=MA,ng=-1;
      while(abs(ok-ng)>1){
        ll mid=(ok+ng)/2;

        ll d=mid;
        ll w=W[now];
        bool dame=false;
        for(int j=i-1;j>=0;j--){
          int tar=ord[j];
          ll nw=w+W[tar];
          int z=upper_bound(all(v),d)-v.begin();
          if(dp[z]<nw){
            dame=true;
            break;
          }
          d+=dist[j];
          w=nw;
        }
        if(dame) ng=mid;
        else ok=mid;
      }

      dist.push_back(ok);
    }
    ll res=0;
    rep(i,dist.size()) res+=dist[i];
    chmin(ans,res);
  }while(next_permutation(all(ord)));

  cout<<ans<<endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()

int main() {

ll N;
cin>>N;
ll n=sqrt(N);
ll ans=N;
vector<bool> vec(n,false);
for(ll i=2;i<=n;i++) {
    if(vec[i-1]) {
        continue;
    }
    ll k=i;
    ans++;
    while(k<=N) {
        ans--;

        if(k<=n) vec[k-1]=true;
        k*=i;
    }
}

cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
#define vi vector<int>
#define vl vector<ll>

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

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}

int main()
{
    ll n;
    ll ans = 0;
    cin >> n;
    map<ll, int>mp;

    for(ll i = 2; i * i <= n; i++) {
        ll now = i * i;

        while(now <= n) {
            //cout << now << endl;
            if(now <= n) {
                mp[now]++;
            } else {
                break;
            }
            now = now * i;
        }
    }

/*
    for(ll i = 2; i * i <= n; i++) {

        ll now = i * i * i * i;
        if(now > n) break;
        while(now <= n) {
            if(now <= n) ans--;
            else break;
            now = now * i;
        }
    }
    */

    cout << n - mp.size() << endl;
    return 0;
}


// Template
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <tuple>
#include <utility>
#include <queue>
#include <set>
#include <map>
#define rep_override(x, y, z, name, ...) name
#define rep2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep3(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define rep(...) rep_override(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
constexpr int inf = 1001001001;
constexpr ll infll = 3003003003003003003LL;
template <typename T>
inline bool chmin(T &x, const T &y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}
template <typename T>
inline bool chmax(T &x, const T &y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &element : vec) is >> element;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    for (int i = 0, vec_len = (int)vec.size(); i < vec_len; ++i) {
        os << vec[i] << (i + 1 == vec_len ? "" : " ");
    }
    return os;
}
struct IOSET {
    IOSET() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
    }
} ioset;

// Main
int main() {
    int n, m;
    cin >> n >> m;
    vector<int> x(m), y(m), z(m);
    rep(i, m) cin >> x[i] >> y[i] >> z[i];

    vector<vector<int>> idx(n + 1);
    rep(i, m) idx[x[i]].push_back(i);

    vector<ll> dp(1 << n, 0);
    dp[0] = 1;
    rep(i, 1, 1 << n) {
        bool ok = true;
        for (int j : idx[__builtin_popcount(i)]) {
            int cnt = __builtin_popcount(i & ((1 << y[j]) - 1));
            if (cnt > z[j]) ok = false;
        }
        if (ok) {
            rep(j, n) {
                if (i & (1 << j)) {
                    dp[i] += dp[i ^ (1 << j)];
                }
            }
        }
    }

    cout << dp[(1 << n) - 1] << "\n";
}

#include <bits/stdc++.h>

int main(){
    int N, M;
    std::cin >> N >> M;

    std::vector< std::pair< int, std::pair< int, int > > > XYZ(M);
    for(int i=0; i<M; i++){
        std::cin >> XYZ[i].first >> XYZ[i].second.first >> XYZ[i].second.second;
        //XYZ[i].first--;
        XYZ[i].second.first--;
    }

    std::sort(XYZ.begin(), XYZ.end());

    std::vector< std::vector< int > > Y(N+1);
    std::vector< std::vector< int > > Z(N+1);
    for(int i=0; i<M; i++){
        Y[XYZ[i].first].push_back(XYZ[i].second.first);
        Z[XYZ[i].first].push_back(XYZ[i].second.second);
    }

    int pat = 1 << N;
    std::vector< std::vector< long long > > num(N+1, std::vector< long long >(pat, 0));
    for(int i=0; i<N; i++){
        num[i+1] = num[i];
        for(int j=0; j<pat; j++){
            int mask = 1 << i;
            if(j & mask){
                num[i+1][j]++;
            }
        }
    }

    std::vector< long long > DP(pat, 0);
    std::vector< long long > DPnum(pat, 0);
    DP[0] = 1;
    for(int i=0; i<pat; i++){
        for(int j=0; j<Y[DPnum[i]].size(); j++){
            if(num[Y[DPnum[i]][j]+1][i] > Z[DPnum[i]][j]){
                DP[i] = 0;
            }
        }
        for(int k=0; k<N; k++){
            int mask = 1 << k;
            if((i & mask) == 0){
                DP[i | mask] += DP[i];
                DPnum[i | mask]++;
            }
        }
    }

    //for(int i=0; i<pat; i++){
    //    std::cout << DP[i] << " ";
    //}
    //std::cout << std::endl;

    std::cout << DP[pat-1] << std::endl;

    return 0;
}


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

const int N=2e5+5;

inline int read()
{
	int 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*10+c-'0';
		c=getchar();
	}
	return x*f;
}

int n,a[N],b[N],c[N*2],re[N*2],len=0;
inline int Find(int x)
{
	return lower_bound(re+1,re+len+1,x)-re;
}
vector<int> re1[N*2],re2[N*2];
int tree[N],p[N];
inline int lowbit(int x)
{
	return x&(-x);
}
inline void add(int place)
{
	for(int i=place;i<=n;i+=lowbit(i))
		tree[i]++;
}
inline int ask(int place)
{
	int ans=0;
	for(int i=place;i;i-=lowbit(i))
		ans+=tree[i];
	return ans;
}
int main()
{
	n=read();
	for(int i=1;i<=n;i++) c[i]=a[i]=read()+i;
	for(int i=1;i<=n;i++) c[i+n]=b[i]=read()+i;
	sort(c+1,c+n*2+1);
	for(int i=1;i<=n*2;i++)
		if(c[i]!=c[i-1])
			re[++len]=c[i];
	for(int i=1;i<=n;i++) a[i]=Find(a[i]),b[i]=Find(b[i]);
	for(int i=1;i<=n;i++) re1[a[i]].push_back(i);
	for(int i=1;i<=n;i++) re2[b[i]].push_back(i);
	for(int i=1;i<=len;i++)
	{
		int siz1=re1[i].size(),siz2=re2[i].size();
		if(siz1!=siz2)
		{
			printf("-1\n");
			return 0;
		}
		for(int j=0;j<siz1;j++) p[re1[i][j]]=re2[i][j];
	}
	long long ans=0;
	for(int i=n;i>=1;i--) ans+=ask(p[i]), add(p[i]);
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) begin(x),end(x)
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define mod 1000000007
using ll=long long;
const int INF=1000000000;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

struct IOSetup{
    IOSetup(){
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout<<fixed<<setprecision(12);
    }
} iosetup;

template<typename T>
ostream &operator<<(ostream &os,const vector<T>&v){
    for(int i=0;i<(int)v.size();i++) os<<v[i]<<(i+1==(int)v.size()?"":" ");
    return os;
}
template<typename T>
istream &operator>>(istream &is,vector<T>&v){
    for(T &x:v)is>>x;
    return is;
}

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

template<ll Mod>
struct ModInt{
    long long x;
    ModInt():x(0){}
    ModInt(long long y):x(y>=0?y%Mod:(Mod-(-y)%Mod)%Mod){}
    ModInt &operator+=(const ModInt &p){
        if((x+=p.x)>=Mod) x-=Mod;
        return *this;
    }
    ModInt &operator-=(const ModInt &p){
        if((x+=Mod-p.x)>=Mod)x-=Mod;
        return *this;
    }
    ModInt &operator*=(const ModInt &p){
        x=(int)(1ll*x*p.x%Mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p){
        (*this)*=p.inverse();
        return *this;
    }
    ModInt operator-()const{return ModInt(-x);}
    ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
    ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
    ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
    ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
    bool operator==(const ModInt &p)const{return x==p.x;}
    bool operator!=(const ModInt &p)const{return x!=p.x;}
    ModInt inverse()const{
        int a=x,b=Mod,u=1,v=0,t;
        while(b>0){
            t=a/b;
            swap(a-=t*b,b);swap(u-=t*v,v);
        }
        return ModInt(u);
    }
    ModInt pow(long long n)const{
        ModInt ret(1),mul(x);
        while(n>0){
            if(n&1) ret*=mul;
            mul*=mul;n>>=1;
        }
        return ret;
    }
    friend ostream &operator<<(ostream &os,const ModInt &p){return os<<p.x;}
    friend istream &operator>>(istream &is,ModInt &a){long long t;is>>t;a=ModInt<Mod>(t);return (is);}
    static int get_mod(){return Mod;}
};

using mint=ModInt<998244353>;

vector<vector<int>> f(5000,vector<int>(5000,-1));
vector<vector<mint>> dp(5001,vector<mint>(5001,0));

signed main(){
    int h,w,k;cin>>h>>w>>k;
    rep(_,k){
        int i,j;char c;cin>>i>>j>>c;i--,j--;
        if(c=='R') f[i][j]=0;
        if(c=='D') f[i][j]=1;
        if(c=='X') f[i][j]=2;
    }

    // naive
    {
        dp[0][0]=1;
        rep(i,h){
            rep(j,w){
                if(f[i][j]<0 and (i!=h-1 or j!=w-1)){
                    dp[i][j]*=2;
                    dp[i][j]/=3;
                }
                if(f[i][j]<0){
                    if(i+1<h) dp[i+1][j]+=dp[i][j];
                    if(j+1<w) dp[i][j+1]+=dp[i][j];
                }
                if(f[i][j]==0){
                    if(j+1<w) dp[i][j+1]+=dp[i][j];
                }
                if(f[i][j]==1){
                    if(i+1<h) dp[i+1][j]+=dp[i][j];
                }
                if(f[i][j]==2){
                    if(i+1<h) dp[i+1][j]+=dp[i][j];
                    if(j+1<w) dp[i][j+1]+=dp[i][j];
                }
            }
        }
    }
    // rep(i,h){
    //     rep(j,w){
    //         cout<<dp[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    cout<<dp[h-1][w-1]*mint(3).pow(h*w-k)<<endl;
    return 0;
}


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

int main()
{
    int n, x;
    string s;
    cin >> n >> x;
    cin >> s;
    int cnt=x;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='x' && cnt>0)cnt--;
        else if(s[i]=='o')cnt++;
    }
    cout << cnt;
}

#include <bits/stdc++.h>
//#include "/home/amal/basic.h"
using namespace std;
#define ll long long
#define boost 	ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define loop(i,n) for(ll i=0;i<n;i++)
#define tc() int t;cin>>t;while(t--)
int main()
{
	boost
	#ifndef Amal
	//	freopen("/home/amal/Desktop/programming/c++/practise/input_test1.txt","r",stdin);
			//freopen("/home/amal/Desktop/programming/c++/practise/output_test1.txt","w",stdout);
	#endif
			int n,x;
			cin>>n>>x;
			string s;
			cin>>s;

			int mark=x;

			for(int i=0;i<n;i++)
			{
				//cout<<mark<<" ";
				if(s[i]=='o')
					mark++;
				else if(s[i]=='x')
				{
					if(mark>0)
						mark--;
				}
			}

			cout<<mark;
}


#include <bits/stdc++.h>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法
#define MOD2 1000007

using namespace std;
typedef long long ll;

/*
0のアスキー　"48"
*/

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) x.begin(),x.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

typedef std::priority_queue<ll> LLPrioQueue;
typedef std::priority_queue<ll, std::vector<ll> , std::greater<ll> > LLReversePrioQueue;

int main(){

    int N;
    cin >> N;
    vector<string> s(N);
    for(ll i = 0;i < N;i++)
        cin >> s.at(i);
    vector<ll> A(N,0);
    ll cnt = 1;
    for(ll i = 0;i < N;i++){
        if(s.at(i) == "AND"){
            continue;
        }else{
            ll a = 1;
            for(int j = 0;j < i+1;j++)
                a *= 2;
            cnt += a;
        }
    }

    cout << cnt << endl;

    return 0;

}

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

template<typename T>
int ex(T p){
  T a = 1;
  if(p == 0){
    return a;
  }
  else{
    for(T i = 1; i <= p; i++){
      a = a*i%1000000007;
    }
    return a;
  }
}
template<typename T>
int eq(T p, T q){
    T r,s = 0,nextp,prevp = 0,prev2p = 1;
    if(q != 1){
        while(s != 1){
            r = p/q; s = p%q;
            nextp = prevp;
            prevp = prev2p - r * prevp;
            prev2p = nextp;
            p = q; q = s;
        }
    return prevp;
    }
    else{
      return 0;
    }
}
template<typename T>
int com(T p,T q){
  T a,b,c,mod = 1000000007;
  a = ex(p);
  b = ex(q);
  for(T i = 1; i <= p-q; i++){
    b = b*i%mod;
  }
  if(b != 1){
    c = ((1 - eq(mod,b)*mod )/b + mod) %mod;
  }
  else{
    c = 1;
  }
  return a*c%mod;
}
template<typename T>
int gcd(T p,T q){
    T s;
    while(q != 0){
        s = p%q;
        p = q; q = s;
    }
    return p;
}
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  vector<long long> T(N+1),F(N+1);
  T[0] = 1;F[0] = 1;
  for(int i = 0; i < N; i++){
    cin >> S[i];
    if(S[i] == "AND"){
      T[i+1] = T[i];
      F[i+1] = 2*F[i] + T[i];
    }
    else{
      T[i+1] = 2*T[i] + F[i];
      F[i+1] = F[i];
    }
  }
  cout << T[N] << endl;
}


/*
  Problem Name:Graph Smoothing
  algorithm tag:矩阵快速幂
*/

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-4;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
//#define x first
//#define y second
#define iosf ios::sync_with_stdio(false), cin.tie(0), cout << fixed

const int N = 110;

typedef long long ll;

int n;

struct Matrix
{
    int a[N][N];
    Matrix() { memset(a, 0, sizeof(a)); }
    int *operator[](int x)
    {
        return a[x];
    }
    Matrix operator*(Matrix b)
    {
        Matrix res;
        for (int k = 1; k <= n; k++)
            for (int i = 1; i <= n; i++)
                for (int j = 1; j <= n; j++)
                    res[i][j] = (res[i][j] + (ll)a[i][k] * b[k][j]) % mod;
        return res;
    }
} E;

Matrix Pow(Matrix x, int y)
{
    Matrix res = E;
    for (; y; y >>= 1, x = x * x)
        if (y & 1)
            res = res * x;
    return res;
}

int Pow(int x, int y)
{
    int res = 1;
    for (; y; y >>= 1, x = (ll)x * x % mod)
        if (y & 1)
            res = (ll)res * x % mod;
    return res;
}

int ind[N], A[N];

int main()
{
    int m, k;
    scanf("%d%d%d", &n, &m, &k);
    int inv = Pow(2 * m, mod - 2);
    for (int i = 1; i <= n; i++)
        scanf("%d", &A[i]);
    for (int i = 1; i <= n; i++)
        E[i][i] = 1;
    Matrix base;
    for (int i = 1; i <= m; i++) {
        int a, b;
        scanf("%d%d", &a, &b), ind[a]++, ind[b]++;
        base[a][a] = base[b][b] = base[a][b] = base[b][a] = inv;
    }
    for (int a = 1; a <= n; a++) {
        base[a][a] = (ll)(2 * m - ind[a]) * inv % mod;
    }
    base = Pow(base, k);
    for (int i = 1; i <= n; i++) {
        int res = 0;
        for (int j = 1; j <= n; j++)
            res = (res + (ll)A[j] * base[j][i]) % mod;
        printf("%d\n", res);
    }
}

#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
int dp[2][100][100];
int AB[200], *A = AB, *B = AB + 100;
ll uke[100][100];
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N, M, K;
	cin >> N >> M >> K;
	rep(i, N) {
		cin >> A[i];
	}
	auto mae = dp[0], ato = dp[1];
	rep(i, N) uke[i][i] = 1;
	int are = modpow(2 * M, mod - 2);

	rep(i, M) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		uke[x][x] -= are;
		uke[x][y] += are;
		uke[y][x] += are;
		uke[y][y] -= are;
	}
	rep(x, N) rep(y, N) mae[x][y] = (uke[x][y] % mod + mod) % mod;

	const ll ma = (1ll << 32) - 1;

	rep(i, 30) {
		if (K >> i & 1) {
			rep(i, N) {
				ll t1 = 0, t2 = 0;
				rep(j, N) {
					auto tmp = (ll)mae[i][j] * A[j];
					t1 += tmp >> 32;
					t2 += tmp & ma;
				}
				B[i] = ((t1 % mod << 32) + t2) % mod;
			}
			swap(A, B);
		}
		if (!K | i >= 31 - __builtin_clz(K)) break;
		rep(x, N) rep(y, x + 1) {
			auto tmp1 = mae[x];
			auto tmp2 = mae[y];
			ll t1 = 0, t2 = 0;
			rep(z, N) {
				auto tmp = *tmp1++ * (ll)*tmp2++;
				t1 += tmp >> 32;
				t2 += tmp & ma;
			}
			ato[y][x] = (ato[x][y] = ((t1 % mod << 32) + t2) % mod);
		}
		swap(mae, ato);
	}

	rep(i, N) co(A[i]);

	Would you please return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod = 1e9 + 7;
void dfs(ll i, ll p, vector<vector<pair<ll,ll>>>& adj,vector<ll>& xors)
{

    for(auto t : adj[i])
    {
        if(t.first!=p)
        {
            xors[t.first] = xors[i]^t.second;
            dfs(t.first,i,adj,xors);
        }
    }

}

int main()
{
    ll t = 1;
    // cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        vector<vector<pair<ll,ll>>> adj(n);
        for(ll i = 0; i<n-1; i++)
        {
            ll x, y, w;
            cin>>x>>y>>w;
            x--; y--;
            adj[x].push_back({y,w});
            adj[y].push_back({x,w});
        }
        vector<ll> xors(n,0);
        dfs(0,-1,adj,xors);
        ll ans = 0;
        for(ll i = 0; i<=60; i++)
        {
            ll cnt = 0;
            for(ll j = 0; j<n;j++)
            {
                if((xors[j])&(1ll<<i)) cnt++;
            }
            ans = (ans + ((cnt*(n-cnt))%mod)*((1ll<<i)%mod))%mod;
        }
        cout<<ans<<endl;
    }
}

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i = 0; i < (n); ++i)
#define DREP(i,s,n) for(int i = (s); i < (n); i++)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;
const int MOD = 1000000007;
const double pi = acos(-1);
ll gcd(ll a, ll b) {if(b == 0) return a; else return gcd(b,a%b);}
ll lcm(ll a, ll b) {return a*b/gcd(a,b);}

struct edge{
    int to;
    ll cost;
};

veci seen;
vecl dp;

void dfs(int i,ll rec,vector<vector<edge>> &G) {
    seen[i] = 1;
    dp[i] = rec;
    for(auto e : G[i]) {
        int ni = e.to;
        if(seen[ni]) continue;
        ll d = e.cost;
        dfs(ni,rec^d,G);
    }
}

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

int main() {
    int N; cin >> N;
    vector<vector<edge>> G(N);
    REP(i,N-1) {
        int a,b; cin >> a >> b;
        a--,b--;
        ll w; cin >> w;
        G[a].push_back({b,w});
        G[b].push_back({a,w});
    }

    ll ans = 0;

    seen = veci(N);
    dp = vecl(N);
    dfs(0,0LL,G);

    // REP(i,N) cout << dp[i] << " ";
    // cout << endl;

    REP(i,60) {
        ll cnt1 = 0;
        ll cnt0 = 0;
        REP(j,N) {
            if((dp[j]>>i)&1) cnt1++;
            else cnt0++;
        }
        ans += (cnt1*(cnt0))%MOD * (modpow(2,i,MOD));
        ans %= MOD;
    }
    ans %= MOD;

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


#include <bits/stdc++.h>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
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;}
static const ll INF=1e18;
static const ll MAX=101010;
//static const ll MOD=1e9+7;
static const ll MOD=998244353;
//for(i=0;i<N;i++) cin>>a[i];

class sumSegTree {
public:
  ll n, height;
  vector<ll> data;

  sumSegTree(ll _n) {
    n=1;
    height=1;
    while(n<_n) {
      n*=2;
      height++;
    }
    data=vector<ll>(2*n-1);
  }

  void add(ll i, ll x) {
    i+=n-1;
    data[i]+=x;
    while(i>0) {
      i=(i-1)/2;
      data[i]+=x;
    }
  }

  //[a, b):要求区間，[l, r):対象区間
  ll _sum(ll a, ll b, ll k, ll l, ll r) {
    if(r<=a || b<=l) return 0;
    if(a<=l && r<=b) return data[k];
    else {
      ll s=_sum(a, b, 2*k+1, l, (l+r)/2);
      ll t=_sum(a, b, 2*k+2, (l+r)/2, r);
      return s+t;
    }
  }

  ll sum(ll a, ll b) {
    return _sum(a, b, 0, 0, n);
  }

};

int main(void) {
  ll i, j, k;

  ll H,W,M;
  cin>>H>>W>>M;
  vector<vector<ll>> yoko(H,vector<ll>{W}),tate(W,vector<ll>({H}));
  for(i=0;i<M;i++){
    ll x,y;
    cin>>x>>y;x--;y--;
    yoko[x].push_back(y);
    tate[y].push_back(x);
  }
  for(i=0;i<H;i++) sort(yoko[i].begin(), yoko[i].end());
  for(j=0;j<W;j++) sort(tate[j].begin(), tate[j].end());

  ll ans=0;
  ll f=0;
  for(j=0;j<yoko[0][0];j++) ans+=tate[j][0];

  sumSegTree sst(W+1);
  for(j=yoko[0][0];j<W;j++) sst.add(j,1);
  for(i=0;i<tate[0][0];i++){
    ans+=sst.sum(0, yoko[i][0]);

    for(auto u:yoko[i]){
      if(sst.sum(u, u+1)==0)
        sst.add(u, 1);
    }

  }
  pt(ans);

}


// Problem: A - Vanishing Pitch
// Contest: AtCoder - AtCoder Beginner Contest 191
// URL: https://atcoder.jp/contests/abc191/tasks/abc191_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Parsed on: 06-02-2021 17:32:16 IST (UTC+05:30)
// Author: Kapil Choudhary
// ********************************************************************
// कर्मण्येवाधिकारस्ते मा फलेषु कदाचन |
// मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि || १.४७ ||
// ********************************************************************

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

#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define PI 3.1415926535897932384626
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << ", " << #y << "=" << y << endl
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int>	vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii>	vpii;
typedef vector<pll>	vpll;
typedef vector<vi> vvi;
typedef vector<vll>	vvll;
typedef vector<vull> vvull;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
    uniform_int_distribution<int> uid(0,lim-1);
    return uid(rang);
}

const int INF = 0x3f3f3f3f;
const int mod = 1e9+7;

void solve()
{
  	int v, t, s, d;
  	cin >> v >> t >> s >> d;

  	int d1 = t * v, d2 = s * v;
  	if(d < d1 || d > d2) cout << "Yes\n";
  	else cout << "No\n";
}

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

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

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

    return 0;
}

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

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

int fact[N], inv[N];

int mul(int a, int b){
    a = (a + mod) % mod;
    b = (b + mod) % mod;
    return 1ll * a * b % mod;
}

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

int fp(int b, int p){
    if(!p) return 1;
    ll ret = fp(b, p >> 1);
    ret = ret * ret % mod;
    if(p&1) ret = ret * b % mod;
    return ret;
}

void pre(){
    fact[0] = inv[0] = 1;
    for(int i = 1; i < N; i++){
        fact[i] = mul(fact[i - 1], i);
        inv[i] = fp(fact[i], mod - 2);
    }
}

int ncr(int n, int r){
    if(r > n || r < 0) return 0;
    int ret = mul(fact[n], inv[n - r]);
    return mul(ret, inv[r]);
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    pre();
    int n, m, k;
    cin >> n >> m >> k;
    if(n > m + k) return cout << 0, 0;
    cout << add(ncr(n + m, n), -ncr(n + m, m + k + 1));

    return 0;
}


    //For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second

    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            int n,i,j;
            cin>>n;
            ll ar[n+1],sum=0,maxi=0,ct=0,ans=0;
            for(i=1;i<=n;++i)
            {
                cin>>ar[i];
                ans=max(ans,ct+maxi);
                sum=sum+ar[i];
                maxi=max(maxi,sum);
                ct=ct+sum;
                ans=max(ans,ct);
            }
            cout<<ans<<endl;
        }
        return 0;
    }

        #pragma GCC optimize("Ofast")
        #include<bits/stdc++.h>
        #define vll vector<long long>
        #define vi vector<int>
        #define ll long long
        #define mp make_pair
        #define p push
        #define pb push_back
        #define np next_permutation
        #define mpl map<ll,ll>
        #define fin(i,a,b) for(int i=a;i<=b;i++)
        #define finr(i,a,b) for(int i=a;i>=b;--i)
        #define max3(a,b,c) max(max(a,b),c)
        #define min3(a,b,c) min(min(a,b),c)
        #define all(v) v.begin(),v.end()
        #define allr(v) v.rbegin(),v.rend()
        #define debug(x) cerr << #x << " = " << x << endl;
        const ll INF =1e18;
        const ll mod =1e9+7;
        using namespace std;
        int main(){
               int n;
               cin>>n;
              // vll v;
               ll pref[n+1];
               pref[0]=0;
               ll end[n+1];
               end[0]=0;
               fin(i,1,n){
                   ll x;
                   cin>>x;
                   pref[i]=pref[i-1]+x;
                   end[i]=end[i-1]+pref[i];

               }
               ll ans=0;
               ll mx=0;
               fin(i,1,n){
                  mx=max(mx,pref[i]);
                  ans=max(ans,end[i-1]+mx);

               }
               cout<<ans<<endl;

            return 0;
        }


#include<bits/stdc++.h>
#include<vector>
#include<math.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 200005
#define PMAX 55
#define EPS 0.000001
#define INF 2000000000000000000
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
pair<double,double> polar_co(double x,double y)
{
    pair<double,double> ans;
    if(abs(x)<EPS)
    {
        if(y<0) ans.second=-acos(-1)/2;
        else ans.second=acos(-1)/2;
    }
    else
    {
        ans.second=atan(y/x);
        if(x<0)
        {
            if(y>0) ans.second=ans.second+acos(-1);
            else ans.second=ans.second-acos(-1);
        }
    }
    ans.first=sqrt(x*x+y*y);
    return ans;
}
pair<double,double> cart_co(pair<double,double> p)
{
    pair<double,double> ans=make_pair((p.first)*(cos(p.second)),(p.first)*(sin(p.second)));
    return ans;
}
int main()
{
    int n,i;
    scanf("%d",&n);
    double x[2],y[2];
    for(i=0;i<2;i++)
    {
        scanf("%lf %lf",&x[i],&y[i]);
    }
    double cx=(x[0]+x[1])/2;
    double cy=(y[0]+y[1])/2;
    double angle=acos(-1);
    angle=angle*2/n;
    for(i=0;i<2;i++)
    {
        x[i]-=cx;
        y[i]-=cy;
    }
    pair<double,double> p=polar_co(x[0],y[0]);
    //printf("Pol(%f,%f)\n",p.first,p.second);
    p.second=p.second+angle;
    p=cart_co(p);
    //printf("car(%f,%f)\n",p.first,p.second);
    p.first=p.first+cx;
    p.second=p.second+cy;
    printf("%f %f",p.first,p.second);
    return 0;
}

#include <bits/stdc++.h>
// #include <atcoder/all> // NOTE: AtCoderライブラリ
using namespace std;
// using namespace atcoder; // NOTE: AtCoderライブラリ
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl;
#define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;
#define nl() cout << "========================================" << endl;
#define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<long long, long long>> vpll;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int main() {
    double N; cin >> N;
    double x0, y0, x2, y2; cin >> x0 >> y0 >> x2 >> y2;

    double d = (2.0 * M_PI) / N;

    double xq = (x0 + x2) / 2.0;
    double yq = (y0 + y2) / 2.0;
dbg2(xq, yq);
    double resx = (x0 - xq) * cos(d) - (y0 - yq) * sin(d) + xq;
    double resy = (x0 - xq) * sin(d) + (y0 - yq) * cos(d) + yq;

    cout << fixed << setprecision(10) << resx << " " << resy << endl;
}


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

int main() {
    int T;
    cin >> T;
    while (T--) {
        string S;
        cin >> S;

        string SS = S;
        sort(SS.rbegin(), SS.rend());
        if (SS < "atcoder") {
            cout << -1 << endl;
            continue;
        }

        int ans = 1005;
        for (int i = 0; i < S.size(); i++) {
            if (!i) {
                if (S > "atcoder") {
                    ans = 0;
                }
            }
            else {
                string cp = S;
                for (int j = 0; j < i; j++) {
                    swap(cp[i - j], cp[i - j - 1]);
                    if (cp > "atcoder") {
                        ans = min(ans, j + 1);
                        break;
                    }
                }
            }
        }

        cout << ans << endl;
    }

    return 0;
}

#include <iostream>
using namespace std;

int ans[1000];
int main()
{
	int n;
	cin>>n;
	string t,s="atcoder";
	for(int i=0;i<n;i++)
	{
		cin>>t;
		int cnt=0;
		if(t>s){ans[i]=0;continue;}
		for(int j=0;j<t.size();j++)
		{
			if(t[j]!='a')
			{
				if(t[j]>'t')cnt--;
				break;
			}
			cnt++;
		}
		if(cnt==t.size())ans[i]=-1;
		else ans[i]=cnt;
	}
	for(int i=0;i<n;i++)
		cout<<ans[i]<<endl;
	return 0;
}


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

void solve(){

int x,y ;
cin>>x>>y ;

if(abs(x-y)<3){
	cout<<"Yes" ;
}
else{
	cout<<"No" ;
}

}

int main(){

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

		cin.tie(0);
		cout.tie(0);
		ios_base::sync_with_stdio(false);

		int y ;

		y=1 ;
		//cin>>y ;

		while(y--){

			solve() ;

		}

		return 0 ;
}

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

    return 0;
}


#include <bits/stdc++.h>

#define loop(s, e, i) for (int i = s; i < e; ++i)
#define print(s) cout << s << endl;
#define DIV 1000000007
#define ll long long
using namespace std;

const int INF = 1e9+7;

ll ceildiv(ll a, ll b) { return (a+b-1)/b; } // 切り上げ
ll floordiv(ll a, ll b) { return a/b; } // 切り下げ

int show_matrix(vector<vector<int>> &dp) {
  loop(0, dp.size(), i) {
    loop(0, dp[i].size(), j) {
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
  return 0;
}

ll power_mod(ll n, ll k, ll mod) {
  ll result = 1;
  while(k > 0) {
    if ((k & 1) == 1) result = (result * n) % mod;
    n = n*n % mod;
    k >>= 1;
  }
  return result;
}

/*
浮動小数点の入力
cout << fixed << setprecision(9) << endl;
*/

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

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

  ll M2 = M * M;
  ll a = 1;

  ll b = power_mod(10, N, M2);
  print (b / M);
}

#include<bits/stdc++.h>
using namespace std;
#define D(x) cout<<__LINE__<<" : "<<#x<<" = "<<x<<endl

int t, n, _max, m,  x, y, tc;

int main() {
    //freopen("input.txt","r",stdin);
    cin>>n>>m;
    puts(m%n == 0 ? "Yes" : "No");
    return 0;
}


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

#define ub              upper_bound
#define lb              lower_bound
#define isrt            insert
#define clr             clear
#define rsz             resize
#define ff              first
#define ss              second
#define lli             long long int
#define pb              push_back
#define pf              push_front
#define mkp              make_pair
#define pii             pair<lli,lli>
#define vi              vector<int>
#define mii             map<lli,lli>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             998244353
#define INF             1e9
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define endl            "\n"
const double PI = acos(-1);

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

lli maxm(lli a, lli b)
{
  return (a >= b ? a : b);
}

lli minm(lli a, lli b)
{
  return (a <= b ? a : b);
}

lli power(lli x, lli y, lli p)
{
  lli res = 1;

  x = x % p;
  if (x == 0)
    return 0;

  while (y > 0)
  {

    if (y & 1)
      res = (res * x) % p;

    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}

lli nCrmodp(lli n, lli r, lli p)
{
  if (r == 0)
    return 1;
  if (r == 1)
    return n;

  lli pro = 1, k = n;
  while (k > r)
  {
    pro *= k;
    pro %= p;
    --k;
  }

  k = 2;
  while (k <= (n - r))
  {
    pro *= power(k, (p - 2), p);
    pro %= p;
    ++k;
  }

  return pro;
}

lli first_big(lli n, lli k, vector<lli> arr)
{
  lli l, r, ans = n;
  l = 0;
  r = n - 1;

  while (l <= r) {
    lli m = l + (r - l) / 2;

    if (arr[m] > k) {
      ans = m;
      r = m - 1;
    }

    else
      l = m + 1;
  }

  return ans;
}

lli last_small(lli n, lli k, vector<lli> arr)
{
  lli l, r, ans = -1;
  l = 0;
  r = n - 1;

  while (l <= r)
  {
    lli mid = (l + r) / 2;

    if (arr[mid] <= k)
    {
      ans = mid;
      l = mid + 1;
    }
    else
      r = mid - 1;
  }

  return ans;
}

void c_p_c()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
lli dp[3001][6001];
lli dfs(lli i, lli j)
{
  if (dp[i][j] == -1)
  {
    if (i < j || i == 0 || j == 0)
      dp[i][j] = 0;
    else
      dp[i][j] = (dfs(i - 1, j - 1) + dfs(i, 2 * j)) % mod;

  }
  return dp[i][j];
}

int main()
{
  c_p_c();
  lli n, k;
  cin >> n >> k;
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 1;
  cout << dfs(n, k) << endl;

  return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define sz(x) (int)(x.size())
#define all(x) x.begin(), x.end()
#define int long long
#define pii pair<int, int>
#define inf 0x3f3f3f3f
#define ar array
#define mod 998244353
#define F first
#define S second
#define wopen(x) freopen((x),"w",stdout)
#define ropen(x) freopen((x),"r",stdin)
#define de(x) cout << #x << " = " << x << ' ';
#define io ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
const int mxN = 3005;

int n, k, f[mxN][mxN];

int dp(int n, int k) {
    if(k > n) return 0;
    if(k == 0 or n == 0) return 0;
    if(f[n][k]) return f[n][k];
    return f[n][k] = (dp(n - 1, k - 1) + dp(n, 2 * k)) % mod;
}

signed main() {
    io;
    cin >> n >> k;
    f[1][1] = 1;
    cout << dp(n, k);
}


#include <bits/stdc++.h>
//#define DEBUG
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fLL;
const int M = 2e5 + 100;
using namespace std;
inline ll read() {
    ll x = 0, f = 1; char ch = getchar();	while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); }while (isdigit(ch)) { x = x * 10 + ch - 48; ch = getchar(); }
    return x * f;
}
void solve() {
    ll n,k;
    cin >> n >> k;
    for (int i = 0; i < k; i++) {
        if (n % 200)n = n * 1000 + 200;
        else n /= 200;
    }
    cout << n << endl;
    return;
}
int main() {
    IO;
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
    //	freopen("output.txt", "w", stdout);
#endif
    int test;
    solve();
    return 0;
}

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n, m; cin >> n >> m;
	int c0 = 0, c1 = 0;
	for (int i = 0; i < n; i++) {
		string s; cin >> s;
		int c = 0;
		for (int j = 0; j < m; j++)
			if (s[j] == '1')
				c++;
		if (c & 1) c1++;
		else c0++;
	}
	cout << 1LL * c0 * c1 << '\n';
	return 0;
}


#include<bits/stdc++.h>
#define N 105
#define P 1000000007
using namespace std;
int n,m,k,t[N],ni,a[N];
void Add(int &x,int y){
	x+=y;
	if(x>=P)x-=P;
}
int fpow(int a,int b){
	int res=1;
	while(b){
		if(b&1)res=1ll*res*a%P;
		a=1ll*a*a%P,b>>=1;
	}return res;
}
struct S{
	int A[N][N];
	S operator *(const S &_)const{
		S res;
		for(int i=1;i<=n;++i)for(int j=1;j<=n;++j)res.A[i][j]=0;
		for(int i=1;i<=n;++i)for(int j=1;j<=n;++j)for(int k=1;k<=n;++k)res.A[i][j]=(res.A[i][j]+1ll*A[i][k]*_.A[k][j])%P;
		return res;
	}
}ans,I;
bool v[N][N];
int main(){
	cin>>n>>m>>k;ni=fpow(2*m,P-2);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]),ans.A[i][i]=1;
	for(int x,y,i=1;i<=m;++i)scanf("%d%d",&x,&y),v[x][y]=v[y][x]=1,++t[x],++t[y];
	for(int i=1;i<=n;++i){
		I.A[i][i]=1ll*(m*2-t[i]+P)*ni%P;
		for(int j=1;j<=n;j++)if(v[i][j])I.A[i][j]=ni;
	}
	for(int i=0;k;++i,I=I*I){
		if(k&(1<<i))k^=(1<<i),ans=ans*I;
	}for(int i=1;i<=n;i++){
		int res=0;
		for(int j=1;j<=n;j++)res=(res+1ll*a[j]*ans.A[i][j])%P;cout<<res<<"\n";
	}
}

//#include<math.h>
#include<algorithm>
#include<stdlib.h>
#include<time.h>
#include<stdio.h>
#include<string.h>
#define un unsigned
#define srd srand(time(0))
#define ll long long
#define con continue
#define gtc getchar()
#define ptc putchar
#define dou double
#define eps 0.00000000001
#define opr operator
#define cl(x,a) memset(x,a,sizeof(x))
#define fo0(i,k) for(i=fr[k];i;i=nx[i])
#define fo1(i,l,r) for(i=l;i<=r;i++)
#define fo2(i,l,r) for(i=l;i>=r;i--)
#define fo(i,n) for(i=1;i<=n;i++)
#define ret return
#define x first
#define cint const int
#define y second
#define opi(x) freopen(x,"r",stdin)
#define opo(x) freopen(x,"w",stdout)
#define tpl template<class T>
#define priq priority_queue
#define mp make_pair
#define use using namespace
#define WT while(T--)
#define pb push_back
#define sz size()
use std;
typedef pair<int,int> pii;typedef pair<int,ll> pil;typedef pair<ll,int> pli;typedef pair<ll,ll> pll;
namespace io
{
	void _(int &k){char c;int e=1;k=0;while((c=gtc)>'9'||c<'0')if(c=='-')e=-1;k=c-'0';while((c=gtc)<='9'&&c>='0'){k*=10;k+=c-'0';}k*=e;}
	void _(ll &k){char c;int e=1;k=0;while((c=gtc)>'9'||c<'0')if(c=='-')e=-1;k=c-'0';while((c=gtc)<='9'&&c>='0'){k*=10;k+=c-'0';}k*=e;}
	void _(char &c){while((c=gtc)==' '||c=='\n');}void _(dou &c){scanf("%lf",&c);}void _(char *s){char c;while((c=gtc)!=EOF&&c!=' '&&c!=10)*s++=c;}
	template<class t1,class t2>void _(t1 &a,t2 &b){_(a);_(b);}template<class t1,class t2,class t3>void _(t1 &a,t2 &b,t3 &c){_(a);_(b);_(c);}
	template<class t1,class t2,class t3,class t4>void _(t1 &a,t2 &b,t3 &c,t4 &d){_(a);_(b);_(c);_(d);}
	template<class t1,class t2,class t3,class t4,class t5>void _(t1 &a,t2 &b,t3 &c,t4 &d,t5 &e){_(a);_(b);_(c);_(d);_(e);}
	void _p(dou k){printf("%.6lf",k);}void _p(char *c){for(;*c;ptc(*c++));}void _p(const char *c){for(;*c;ptc(*c++));}void _p(char c){ptc(c);}
	tpl void _p0(T k){if(k>=10)_p0(k/10);ptc(k%10+'0');}tpl void _p(T k){if(k<0){ptc('-');_p0(-k);}else _p0(k);}tpl void __p(T k){_p(k);ptc(' ');}
	tpl void _pn(T k){_p(k);ptc('\n');}template<class t1,class t2>void _p(t1 a,t2 b){__p(a);_pn(b);}
	template<class t1,class t2,class t3>void _p(t1 a,t2 b,t3 c){__p(a);__p(b);_pn(c);}
	template<class t1,class t2,class t3,class t4>void _p(t1 a,t2 b,t3 c,t4 d){__p(a);__p(b);__p(c);_pn(d);}
	tpl void op(T *a,int n){int i;n--;fo(i,n)__p(a[i]);_pn(a[n+1]);}int gi(){int x;_(x);ret x;}ll gll(){ll x;_(x);ret x;}
}
int gcd(int a,int b){ret b?gcd(b,a%b):a;}void fcl(){fclose(stdin);fclose(stdout);}
void fop(const char *s){char c[256],d[256];cl(c,0);cl(d,0);strcpy(c,s);strcpy(d,s);opi(strcat(c,".in"));opo(strcat(d,".out"));}
int eq(dou a,dou b){return a+eps>=b&&b+eps>=a;}tpl void _ma(T &a,T b){if(a<b)a=b;}tpl void _mi(T &a,T b){if(a>b)a=b;}
cint N=233333,EE=100000000,p=1000000007,ima=2147483647;
use io;
int n,m,c[22][22],f[N][17][17],v[22],po[22][N],sm;
/*int cc(int t,int k)
{
	int rt=0,i;
	if(k>m)
		return 0;
	int d=m-k;
	fo1(i,0,d)
		rt=(rt+(1-(d-i)%2*2)*1ll*po[i+k][t]*c[16-k][i]+(ll)p*p)%p;
	return rt;
}*/
char a[N];
int main()
{
	int i,j,k,a1,a2,an=0;
	scanf(" %s",a+1);
	n=strlen(a+1);
	fo(i,n)
		if(a[i]>='0'&&a[i]<='9')
			a[i]-='0';
		else
			a[i]-='A'-10;
	_(m);
	fo1(i,0,16)
		c[i][0]=1;
	fo(i,16)
		fo(j,16)
			c[i][j]=c[i-1][j]+c[i-1][j-1];
	fo1(i,1,16)
	{
		po[i][0]=1;
		fo(j,n)
			po[i][j]=(ll)po[i][j-1]*i%p;
	}
	fo1(i,0,m)
		f[0][i][i]=1;
	fo(i,n)
		fo(j,m)
			fo1(k,j,m)
				f[i][j][k]=((ll)f[i-1][j][k-1]*(17-k)+(ll)f[i-1][j][k]*k)%p;
	fo(i,n)
		an=(an+15ll*f[i-1][1][m])%p;
	fo(i,n)
	{
		fo1(j,a[i]+1,15)
			an=(an-f[n-i][sm+(!v[j])][m]+p)%p;
		sm+=!v[a[i]];
		v[a[i]]=1;
	}
	_pn(an);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;
const int N = 5007;

int n, m, fn[30];

long long fac[2000006]; // 阶乘表

long long qpow(long long x, long long n) {
	long long res = 1;
	for (; n; n >>= 1, x = x * x % mod)
		if (n & 1) res = res * x % mod;
	return res;
}

long long inv(long long a) { // 返回逆元 费马小定理
	return qpow(a, mod-2)%mod;
}

void solve() { // 计算阶乘表
	fac[0] = 1;
	for(int i = 1;i <= 2000006; i++) {
		fac[i] = (fac[i-1]*i)%mod;
	}
}

long long comb(long long n, long long k) {
	if(k > n) return 0;
	return (fac[n]*inv(fac[k])%mod * inv(fac[n-k])%mod) % mod;
}

ll dp[N][N], C[N][N];
int cat[N][N], top = 1;

ll dfs(int p, int sum, int cnt) {
    if (fn[p] > m) {
        if (sum == m) return 1;
        return 0;
    }
    if (sum > m) return 0;
    if (cnt > n) return 0;
    if (cnt * fn[p] > m) return 0;
    if (cat[p][cnt] == 0) cat[p][cnt] = top++;
    if (dp[sum][cat[p][cnt]] != -1) return dp[sum][cat[p][cnt]];
    ll ans = 0;
    ans += dfs(p, sum , cnt + 2);
    ans %= mod;
    ans += dfs(p + 1, sum + fn[p] * cnt, 0) * C[n][cnt];
    ans %= mod;

    return dp[sum][cat[p][cnt]] = ans;

}

int main() {
    solve();
    fn[0] = 1;
    for (int i = 1; i <= 20; i++) {
        fn[i] = fn[i - 1] * 2;
    }
    cin >> n >> m;
    for (int i = 0; i <= n; i++) {
        C[n][i] = comb(n, i);
    }
    memset(dp, -1, sizeof(dp));
    ll ans = dfs(0, 0, 0);
    cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define beastslayer ios_base::sync_with_stdio(false), cin.tie(NULL);
//typedef pair<int, int> pii;

signed main(){
    beastslayer;
    int n;
    cin>>n;
    string s;
    cin>>s;

    int q;
    cin>>q;

    int c=0;
    while(q--){
        int m,a,b;
        cin>>m>>a>>b;

        if(m==2){
            c++;
        }
        else{
            if(c%2==1){
                if(a>n)
                    a-=n;
                else
                    a+=n;
                if(b>n)
                    b-=n;
                else
                    b+=n;
                swap(s[a-1], s[b-1]);
            }
            else{
                swap(s[a-1], s[b-1]);
            }
        }
    }
    if(c%2==1){
        string ans=s.substr(n,2*n)+s.substr(0,n);
        s=ans;
        cout<<s<<endl;
    }
    else
        cout<<s<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);

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

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

return 0;
}

#include <bits/stdc++.h>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
const ul mod = 1000000007;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    if (n % 2 == 0) {
        cout << "White" << endl;
    } else {
        cout << "Black" << endl;
    }
    return 0;
}


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

ll dp[N][N],a,b,k;

string dfs(ll a,ll b,ll k){
	if (a==0) return string(b,'b');
	if (b==0) return string(a,'a');
	if (dp[a-1][b]>=k){
		return "a"+dfs(a-1,b,k);
	} else {
		return "b"+dfs(a,b-1,k-dp[a-1][b]);
	}
}

int main(){
	cin>>a>>b>>k;
	dp[0][0]=1;
	for (int i=0;i<=a;i++){
		for (int j=0;j<=b;j++){
			if (i>0) dp[i][j]+=dp[i-1][j];
			if (j>0) dp[i][j]+=dp[i][j-1];
		}
	}
	cout<<dfs(a,b,k);
	return 0;
}

#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
#define rep(i,n) for(ll i=0;i<(n);++i)
#define rep2(i,n) for(ll i=1;i<=(n);++i)
#define rep3(i,i0,n) for(ll i=i0;i<(n);++i)
#define rrep(i,n) for(ll i=((n)-1); i>=0; --i)
#define rrep2(i,n) for(ll i=(n); i>0; --i)
#define pb push_back
#define mod 1000000007
#define fi first
#define se second
#define len(x) ((ll)(x).size())
using namespace std;
using ll = long long;
using ld = long double;
using Pi = pair< ll, ll >;
using vl = vector<ll>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<Pi>;
using vvc = vector<vector<char>>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

const ll INF = 1LL << 60;
const ld PI = 3.1415926535897932385;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
void printb(ll N,ll d=16){
    rep(i,d){
        cout<<(N/(1<<(d-i-1)))%2;
    }
    cout<<endl;

}
void printv(vector<ll>a){
    rep(i,a.size()){
        if(i==a.size()-1){
            cout<<a[i]<<endl;
        }else{
            cout<<a[i]<<" ";
        }
    }
}
bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;

    }else{
        return a.second < b.second;
    }
}

//const vector<ll> dx = {1, 0, -1, 0, 1, -1, 1, -1};
//const vector<ll> dy = {0, 1, 0, -1, 1, 1, -1, -1};
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};
const int MAX_N = 62;         // n の最大値
vector<vector<long long>> com;  // 前計算の結果を保存
// 動的計画法で前処理
void init() {
    com.assign(MAX_N, vector<long long>(MAX_N));
    com[0][0] = 1;
    for (int i = 1; i < MAX_N; ++i) {
        com[i][0] = 1;
        for (int j = 1; j < MAX_N; j++) {
            com[i][j] = (com[i - 1][j - 1] + com[i - 1][j]);
        }
    }
}
// nCk を取得
long long nCk(int n, int k) {
    assert(!(n < k));
    assert(!(n < 0 || k < 0));
    return com[n][k];
}

int main() {
    init();
    ll A,B,K;
    cin>>A>>B>>K;

    string ans;
    K--;
    while(1){

        rep(i,A+1){

            //cout<<i<<" "<<K<<" "<<A<<endl;
            if(K>=com[B-1+i][i]){
                K-=com[B-1+i][i];
            }else{
                rep(j,A-i){
                    ans.pb('a');
                }
                ans.pb('b');
                A-=A-i;
                B--;
                //cout<<"b"<<endl;
                break;
            }
        }

        if( B==0)break;
    }

    rep(i,A){
        ans.pb('a');
    }

    cout<<ans<<endl;

    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define vec vector
#define pii pair<int, int>
using namespace std;

const long long MAXVAL = (long long) 1e18 + 1;
//const long long MOD = 1000000007ll;
const long long MOD = 998244353ll;
const int INF = 1000000001;

long long poww(int x, long long pow) {
  if (pow == 0ll ) return 1;
  if (pow == 1ll) return x % MOD;
  long long ans = poww(x, pow >> 1) % MOD;
  ans = (ans * ans) % MOD;
  if ((pow & 1) == 1) {
    ans = (ans * x ) % MOD;
  }
  return ans % MOD;
}

ll gcd(ll x, ll y) {
  if (x == 0) return y;
  while (y) {
    x %= y;
    swap(x, y);
  }
  return x;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int q = 1;
  //cin >> q;
  while (q-- >0) {
    int n;
    cin >> n;
    int m;
    cin >> m;
    vec<int> primes;
    vec<int> minp(m + 1, -1);
    for (int i = 2; i <= m; ++i) {
      if (minp[i] < 0) {
        primes.push_back(i);
      }
      for (int j = 0; j < primes.size() && primes[j] <= i; ++j) {
        if (primes[j] * 1ll * i > m) break;
        minp[primes[j] * i] = j;
      }
    }
    vec<int> combs;
    combs.push_back(1);
    for (int i = 1; i <= 20; ++i) {
      int old = combs[i - 1];
      int new_ = (old * 1ll * (i + n - 1)) % MOD;
      new_ = (new_ * 1ll * poww(i, MOD - 2)) % MOD;
      combs.push_back(new_);
    }
    int res = 0;
    for (int x = m; x > 0; --x) {
      int curres = 1;
      int y = x;
      while (minp[y] >= 0) {
        int p = primes[minp[y]];
        assert (y % p == 0);
        int deg = 0;
        while (y % p == 0) {
          y /= p;
          ++deg;
        }
        curres = (curres * 1ll * combs[deg]) % MOD;
      }
      if (y > 1) {
        curres = (curres * 1ll * combs[1]) % MOD;
      }
      res = (res + curres) % MOD;
    }
    cout << res  << "\n";

  }
}

#include <bits/stdc++.h>
#pragma GCC optimize ("O2,unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<(x)<<endl;
#define debugp(x) cerr<<#x<<"= {"<<(x.first)<<", "<<(x.second)<<"}"<<endl;
#define debug2(x, y) cerr<<"{"<<#x<<", "<<#y<<"} = {"<<(x)<<", "<<(y)<<"}"<<endl;
#define debugv(v) {cerr<<#v<<" : ";for (auto x:v) cerr<<x<<' ';cerr<<endl;}
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const int inf=1000000010;
const ll INF=1000000000000001000LL;
const int mod=998244353;
const int MAXN=300010, LOG=20;

ll n, m, k, u, v, x, y, t, a, b, ans;
ll F[MAXN], I[MAXN];
ll dp[MAXN][LOG];

ll powmod(ll a, ll b){
	ll res=1;
	for (; b; b>>=1, a=a*a%mod) if (b&1) res=res*a%mod;
	return res;
}
ll nCr(ll n, ll r){
	if (r<0 || r>n) return 0;
	return F[n]*I[r]%mod*I[n-r]%mod;
}

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	F[0]=1;
	for (int i=1; i<MAXN; i++) F[i]=F[i-1]*i%mod;
	I[MAXN-1]=powmod(F[MAXN-1], mod-2);
	for (int i=MAXN-1; i; i--) I[i-1]=I[i]*i%mod;
	cin>>n>>m;
	for (int i=1; i<=m; i++){
		dp[i][1]++;
		for (int j=1; j<LOG; j++) if (dp[i][j]){
			ans=(ans + dp[i][j]*nCr(n-1, j-1))%mod;
			for (int k=2*i; k<=m; k+=i) dp[k][j+1]=(dp[k][j+1] + dp[i][j])%mod;
		}
	}
	cout<<ans<<"\n";

	return 0;
}