#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

//-------------------------------------------------
//--ModInt
//-------------------------------------------------
const uint_fast64_t MOD = 998244353;

class mint
{
private:
    using Value = uint_fast64_t;
    Value n;
public:
    mint():n(0){}
    mint(int_fast64_t _n):n(_n<0 ? MOD-(-_n)%MOD : _n%MOD){}
    mint(const mint &m):n(m.n){}

    friend ostream& operator<<(ostream &os, const mint &a){
		return os << a.n;
	}
    friend istream& operator>>(istream &is, mint &a){
        Value temp; is>>temp;
        a = mint(temp);
        return is;
    }

    mint& operator+=(const mint &m){n+=m.n; n=(n<MOD)?n:n-MOD; return *this;}
    mint& operator-=(const mint &m){n+=MOD-m.n; n=(n<MOD)?n:n-MOD; return *this;}
    mint& operator*=(const mint &m){n=n*m.n%MOD; return *this;}
    mint& operator/=(const mint &m){return *this*=m.inv();}
    mint& operator++(){return *this+=1;}
    mint& operator--(){return *this-=1;}

    mint operator+(const mint &m) const {return mint(*this)+=m;}
    mint operator-(const mint &m) const {return mint(*this)-=m;}
    mint operator*(const mint &m) const {return mint(*this)*=m;}
    mint operator/(const mint &m) const {return mint(*this)/=m;}
    mint operator++(int){mint t(*this); *this+=1; return t;}
    mint operator--(int){mint t(*this); *this-=1; return t;}

    bool operator==(const mint &m) const {return n==m.n;}
    bool operator!=(const mint &m) const {return n!=m.n;}
    mint operator-() const {return mint(MOD-n);}

    mint pow(Value b) const {
        mint ret(1), m(*this);
        while(b){
            if (b & 1) ret*=m;
            m*=m;
            b>>=1;
        }
        return ret;
    }

    mint inv() const {return pow(MOD-2);}
};

//-------------------------------------------------

int main(void)
{
    int N,M; cin>>N>>M;
    mint ans = mint(M).pow(N)*N;

    mint M_inv = mint(M).inv();
    mint A = mint(M).pow(N-2);
    FOR(t,1,M){
        mint X = mint(M-t)*M_inv;
        mint D = (mint(1)-X).inv();
        ans -= A*D*(D*(X.pow(N)-1)+N);
    }
    cout<<ans<<"\n";
    return 0;
}

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

int main() {
	// your code goes here

	long long t,n;
	cin>>t>>n;

	cout<<(long long)ceil(100*n/(long double)t)+n-1<<endl;

	return 0;
}


//#include <atcoder/maxflow.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#include <iostream>
#include <map>
#include <list>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <iterator>
#include <random>
#include <chrono>
#include <complex>
#include <bitset>
#include <fstream>

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

typedef long long ll;

//using namespace __gnu_pbds;
//using namespace atcoder;
using namespace std;

const ll modd = (1000LL * 1000LL * 1000LL + 7LL);
//const ll modd = 998244353;

int main(int argc, char *argv[])   {

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

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

    cout.precision(12);

//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readint(n);
        vector<ll> a;
        forr(i,0,n) {
            readll(aa); a.push_back(2*aa);
        }
        sort(a.begin(), a.end());
        vector<ll> summ; summ.push_back(0);
        for(auto x : a) {
            summ.push_back(summ.back() + x);
        }

        ll minval = modd*modd;
        forr(i,0,n) {
            ll val = (ll)(i+1)*a[i]/2 + (summ.back() - summ[i+1]) - (ll)(n-i-1)*a[i]/2;
            minval = min(minval, val);
        }

        cout << (double)minval/static_cast<double>(2*n) << endl;
    }

    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <queue>

using namespace std;
typedef long long ll;

int main(){
  ll X,Y,A,B;
  cin >> X >> Y >> A >> B;
  ll ans = 0;
  while(X<Y/A && X*A<=X+B){
    X *= A;
    ans++;
  }
  ans += (Y-1-X)/B;
  cout << ans << endl;
}


#include <bits/stdc++.h>
typedef long long LL;
using namespace std;
LL n;
int main (){
	cin>>n; LL m=2*n+2, x=sqrt(n);
	while(x*(x+1)>m) x--; while(x*(x+1)<=m) x++;
	n -= x-1; printf("%lld\n",n+1);
}

#include<bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(register int i=a;i<=b;++i)
#define ll long long
inline ll read(){ll x;scanf("%lld",&x);return x;}
ll Abs(ll x){if(x<0)return -x;return x;}

int main()
{
	ll n=read();
	__int128 L=0,R=n+1;
	while(L<R){
		__int128 Mid=(L+R+1)>>1;
		if((__int128)(1+Mid)*Mid/2<=n+1) L=Mid;
		else R=Mid-1;
	}
	cout<<n-(ll)L+1;
	return 0;
}


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

int main(){

//2位を出力して、O(n)で2位の順番を探しだす
int n;
cin >> n;
int n_sub=1;
for(int i=0;i<n;i++){
    n_sub*=2;
}

vector<int> a(n_sub/2);
vector<int> a_sub(n_sub/2);
vector<int> b(n_sub/2);
vector<int> b_sub(n_sub/2);

for(int i=0;i<n_sub;i++){
    if(i<(n_sub/2)){
        cin >> a_sub[i];
        a[i] = a_sub[i];
    }else{
        cin >> b_sub[i-(n_sub/2)];
        b[i-(n_sub/2)] = b_sub[i-(n_sub/2)];
    }
}
sort(a_sub.begin(),a_sub.end());
sort(b_sub.begin(),b_sub.end());

int max_a = a_sub[(n_sub/2)-1];
int max_b = b_sub[(n_sub/2)-1];
int max_c = min(max_a,max_b);

for(int i=0;i<n_sub/2;i++){
    if(a[i]==max_c){
        cout << i+1 << endl;
        return 0;
    }
}

for(int i=0;i<n_sub/2;i++){
    if(b[i]==max_c){
        cout << (n_sub/2)+i+1 << endl;
        return 0;
    }
}

}

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

typedef long long ll;
typedef long double ld;

ll pow(ll a, ll b)
{
  for (int i = 1; i <= b; i++)
  {
    a *= a;
    if (i = b)
      return a;
  }
}

int main()
{
  ll n;
  cin >> n;
  ll max_1 = 0, max_2 = 0;
  ll p = 0, q = 0;
  ll k = pow(2, n - 1);
  vector<ll> a(k * 2);
  for (int i = 0; i < 2 * k; i++)
  {
    cin >> a[i];
  }
  for (int i = 0; i < k; i++)
  {
    if(max_1<=a[i]){
    max_1 = max(max_1, a[i]);
      p=i;
    }

  }
  for (int i = k; i < k * 2; i++)
  {
     if(max_2<=a[i]){
    max_2 = max(max_2, a[i]);
      q=i;
    }
  }

  if (min(max_1, max_2) == max_1)
    cout << p + 1 << endl;
  else
    cout << q + 1 << endl;
}


#include <iostream>
#include <vector>
#include <array>
#include <set>

using namespace std;

int main(){
    int n;
    cin>> n;
    vector<array<int,5> > A(n);
    for(auto& a: A) for(int &i :a) cin>> i;
    //for(auto& a: A) for(int &i :a) cout <<i<<" ";
    int left=0, right = 1e9+1;
    auto check = [&](int x)-> bool{
        set<int> s;
        for(auto& a: A){
            int bit = 0;
            for(int& i :a){
                bit <<=1;
                bit |= i>=x;
            }
            s.insert(bit);
        }
        for(int x: s) for(int y: s) for(int z: s){
            if((x|y|z)==31) return 1;
        }
        return 0;
    };
    while(left+1<right){
        int cen = (left + right) / 2;
        if(check(cen)){
            left = cen;
        }else{
            right = cen;
        }
    }

    cout << left << endl;
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<algorithm>
using namespace std;

const int N=50005;

int n;
int w[N][5],ans;

int mn[N][1<<5],a[N];

inline bool check(int val) {
	for(int i=1 ; i<=n ; ++i) a[i]=0;
	for(int i=1 ; i<=n ; ++i) for(int j=0 ; j<5 ; ++j) if(w[i][j]>=val) a[i]|=1<<j;
	for(int i=1 ; i<=n ; ++i) {
		for(int S=0 ; S<32 ; ++S) mn[i][S]=mn[i-1][S];
		for(int S=0 ; S<32 ; ++S) mn[i][S|a[i]]=min(mn[i-1][S]+1,mn[i][S|a[i]]);
	}
	return mn[n][31]<=3;
}

int main() {
	int l=0,r=1000000000;
	scanf("%d",&n);
	for(int i=1 ; i<=n ; ++i) for(int j=0 ; j<5 ; ++j) scanf("%d",&w[i][j]);
	mn[0][0]=0;
	for(int i=1 ; i<32 ; ++i) mn[0][i]=4;
	while(l<=r) {
		int mid=(l+r)>>1;
		if(check(mid)) ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%d",ans);
	return 0;
}


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

#define ll long long
#define ld long double

#define lop(n) for(ll i=0;i<n;i++)
#define loop(a,b) for(ll i=a;i<b;i++)

#define sortt(x) sort(x.begin(),x.end())

#define MOD 1000000007
#define en "\n"

#define F first
#define S second

#define inputlist for(ll i=0;i<n;i++) cin>>A[i]
#define pb(x) push_back(x)
#define MP make_pair
#define PI 3.14159265

void solve()
{
    ll n;
    cin>>n;
    map<ll,ll> mp;
    for(ll i=0;i<n;i++)
    {
        ll a;cin>>a;mp[a]++;
    }
    vector<ll> vec;
    for(auto itr:mp)
        vec.pb(itr.F);
    ll ans = 1;
    n=vec.size();
    for(ll i=n-1;i>0;i--)
    {
        ans = (ans + ((vec[i]-vec[i-1])*ans)%MOD )%MOD;
    }
    ans = (ans + (vec[0]*ans)%MOD )%MOD;
    cout<<ans;
}

//536870912

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //cin>>s;
    //call();
    // fac[0] = 1;
    // for (int i = 1; i <= 200005; i++)
    //     fac[i] = (fac[i - 1] * i) % MOD;
    ll t=1;

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

//#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <functional>
#include <cstring>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <complex>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define itn int
#define nit int
#define ll long long
#define ms multiset
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define re register
#define ri re int
#define il inline
#define pii pair<int,int>
#define cp complex<double>
//#pra gma G CC opti mize(3)
using namespace std;
using std::bitset;
//using namespace __gnu_pbds;
const double Pi=acos(-1);
namespace fastIO {
	template<class T>
	inline void read(T &x) {
		x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		if(fu)x=-x;
	}
	inline int read() {
		int x=0;
		bool fu=0;
		char ch=0;
		while(ch>'9'||ch<'0') {
			ch=getchar();
			if(ch=='-')fu=1;
		}
		while(ch<='9'&&ch>='0') x=(x*10-48+ch),ch=getchar();
		return fu?-x:x;
	}
	template<class T,class... Args>
	inline void read(T& t,Args&... args) {
		read(t);
		read(args...);
	}
	char _n_u_m_[40];
	template<class T>
	inline void write(T x ) {
		if(x==0){
			putchar('0');
			return;
		}
		T tmp = x > 0 ? x : -x ;
		if( x < 0 ) putchar('-') ;
		register int cnt = 0 ;
		while( tmp > 0 ) {
			_n_u_m_[ cnt ++ ] = tmp % 10 + '0' ;
			tmp /= 10 ;
		}
		while( cnt > 0 ) putchar(_n_u_m_[ -- cnt ]) ;
	}
	template<class T>
	inline void write(T x ,char ch) {
		write(x);
		putchar(ch);
	}
}
using namespace fastIO;
ll n,a[114514],ans=1;
int main() {
	read(n);F(i,1,n)read(a[i]);sort(a+1,a+n+1);
	F(i,1,n)ans=ans*(a[i]-a[i-1]+1)%1000000007;
	write(ans);
	return 0;
}


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

#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
// #include <atcoder/all>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vii = V<int>;
using vvll = V<vll>;
using vvii = V< V<int> >;
using PII = P<int, int>;
using PLL = P<ll, ll>;
#define RevREP(i,n,a) for(ll i=n;i>a;i--)  // (a,n]
#define REP(i,a,n) for(ll i=a;i<n;i++)  // [a,n)
#define rep(i, n) REP(i,0,n)
#define ALL(v) v.begin(),v.end()
#define eb emplace_back
#define pb push_back
#define sz(v) int(v.size())

template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
template< class A, class B > ostream& operator <<(ostream& out, const P<A, B> &p) {
    return out << '(' << p.first << ", " << p.second << ')';
}
template< class A > ostream& operator <<(ostream& out, const V<A> &v) {
    out << '[';
    for (int i=0;i<int(v.size());i++) {
        if (i) out << ", ";
        out << v[i];
    }
    return out << ']';
}

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    vii a(n), b(m);
    set<int> aset, bset;
    rep(i, n) {
        cin >> a[i];
        aset.insert(a[i]);
    }
    rep(i, m) {
        cin >> b[i];
        bset.insert(b[i]);
    }

    vii ans;
    rep(i, n) {
        if (bset.find(a[i]) == bset.end()) ans.eb(a[i]);
    }
    rep(i, m) {
        if (aset.find(b[i]) == aset.end()) ans.eb(b[i]);
    }
    sort(ALL(ans));
    rep(i, sz(ans)) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << '\n';
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;

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

bool a[1001];
bool b[1001];

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        int t;
        cin >> t;
        a[t] = true;
    }

    for (int i = 0; i < m; i++) {
        int t;
        cin >> t;
        b[t] = true;
    }

    for (int i = 1; i < 1001; i++) {
        if (a[i] ^ b[i]) {
            cout << i << " ";
        }
    }
    cout << endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
inline ull Hash(const string& s){
    ull ans=0;
    for(auto c : s)
        ans=ans*26+c-'a';
    return ans;
}
string s;
int N;
set<ull> s1,s2;
inline void work(){
    for(int i=1;i<=N;i++){
        cin>>s;
        set<ull> &t1=(s[0]=='!'?s1:s2);
        set<ull> &t2=(s[0]!='!'?s1:s2);
        reverse(s.begin(),s.end());
        if( *s.rbegin()=='!' ) s.pop_back();
        ull val=Hash(s);
        if( t1.find(val)!=t1.end() ){
            reverse(s.begin(),s.end());
            cout<<s<<endl;
            return ;
        }
        else t2.insert(val);
    }
    cout<<"satisfiable"<<endl;
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>N;
    work();
    return 0;
}

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

struct{template<class T>constexpr operator T(){return numeric_limits<T>::max();}constexpr auto operator-();}inf;
struct{template<class T>constexpr operator T(){return numeric_limits<T>::lowest();}constexpr auto operator-();}negative_inf;
constexpr auto decltype(inf)::operator-(){return negative_inf;}
constexpr auto decltype(negative_inf)::operator-(){return inf;}

#define swap(a,b) {a^=b;b^=a;a^=b;}
#define rep(i,n) for(long long i = 0; i < n; i++)
#define reps(i,s,n) for(long long i = (s); i < n; i++)
#define repr(i,n) for(long long i = (n - 1); i >= 0; i--)
#define LOOP for(long long i = 0;;i++)
#define PB push_back
#define ALL(v) v.begin(),v.end()
#define DOUBLE fixed << setprecision(15)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<vd> vvd;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
typedef pair<ll,ll> P;
typedef vector<P> vP;

#define F first
#define S second
#define SPC << " "

ll gcd(ll x,ll y){if(x<=0||y<=0)return 0;if(y>x){swap(x,y);}return x%y==0?y:gcd(y,x%y);}
ll lcm(ll x,ll y){return x*y/gcd(x,y);}
ll factrial(int x){return x<=1?1:x*factrial(x-1);}
ll nPr(ll n,ll r){ll a=1;rep(i,n-r)a*=(n-i);return a;}
ll nCr(ll n,ll r){ll a=1;rep(i,r){a*=(n-i);a/=(i+1);}return a;}
vP factor(ll n){vP r;if(n<=1)return{};ll m=pow(n,0.5)+1;reps(i,2,m){if(n%i==0){ll c=0;
  while(n%i==0){c++;n/=i;}r.PB({i,c});}if(n<=1)break;}if(n>1)r.PB({n,1});return r;}

int main(){
  string s;
  cin >> s;
  string o;
  rep(i,s.length()){
    if(s[i]=='6') s[i] = '9';
    else if(s[i]=='9') s[i] = '6';
  }
  repr(i,s.length()){
    cout << s[i];
  }
  cout << endl;
}


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

typedef long long LL;
const int mod = 998244353;
const int N = 3000 + 10;

LL dp[N][N];

LL f(LL n, LL k) {
	if(n < k) return 0;
	if(n == k) return 1;
	if(!n) return 0;
	if(!k) return 0;
	if(dp[n][k] != -1) return dp[n][k];
	return dp[n][k] = (f(n - 1, k - 1) + f(n, 2 * k)) % mod;
}

void solve() {
	memset(dp, -1, sizeof dp);
	LL n, k;
	scanf("%lld%lld", &n, &k);
	printf("%lld\n", f(n, k));
}

int main() {
	// freopen("in.txt", "r", stdin);
	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define lowbit(x) (x&-x)
#define reg register
#define mkpr make_pair
#define fir first
#define sec second
typedef long long LL;
typedef unsigned long long uLL;
const int INF=0x3f3f3f3f;
const int mo=998244353;
const LL jzm=2333;
const int iv2=499122177;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
template<typename _T>
void print(_T x){if(x<0){x=(~x)+1;putchar('-');}if(x>9)print(x/10);putchar(x%10+'0');}
int k,cnt1[15],cnt2[15],pow10[10]={1,10,100,1000,10000,100000};
char str1[15],str2[15];LL sum1,sum2;
void sakura(LL num){
	int tmp1=0,tmp2=0;
	for(int i=1;i<=9;i++)tmp1+=i*pow10[cnt1[i]],tmp2+=i*pow10[cnt2[i]];
	sum1+=num;if(tmp1>tmp2)sum2+=num;return ;
}
signed main(){
	read(k);scanf("\n%s\n%s",str1+1,str2+1);
	if(k==1){puts("0");return 0;}
	for(int i=1;i<5;i++)cnt1[str1[i]-'0']++,cnt2[str2[i]-'0']++;
	for(int i=1;i<10;i++)
		for(int j=1;j<10;j++){
			LL tmp=k-cnt1[i]-cnt2[i];cnt1[i]++;
			tmp*=1ll*(k-cnt1[j]-cnt2[j]);cnt2[j]++;
			//printf("%d %d:%d\n",i,j,tmp);
			if(cnt1[i]<=k&&cnt2[j]<=k)sakura(tmp);
			cnt1[i]--;cnt2[j]--;
		}
	printf("%.5f\n",1.0*sum2/sum1);
	return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int T,N;
string S,A="atcoder";

void solve() {
	int i,j,k,l,r,x,y; string s;

	A+='a'-1;

	cin>>T;
	while(T--) {
		cin>>S;
		int ret=1010101;
		FOR(i,8) {
			string T=S;
			int sum=0;
			x=0;
			for(j=0;j<T.size();j++) {
				if(x<i) {
					if(T[j]==A[x]) {
						sum+=j-x;
						rotate(T.begin()+x,T.begin()+j,T.begin()+j+1);
						x++;
					}
				}
				else if(i==x) {
					if(T[j]>A[x]) {
						sum+=j-x;
						rotate(T.begin()+x,T.begin()+j,T.begin()+j+1);
						x=100;
						break;
					}
				}
			}
			if(x==100) ret=min(ret,sum);
		}

		if(ret==1010101) ret=-1;
		cout<<ret<<endl;

	}
}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
typedef long long int ll;
typedef long double ld;
#define MOD 1000000007
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define conts continue
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(), a.rend()
#define no cout << "NO" << endl
#define yes cout << "YES" << endl
#define ff first
#define ss second
#define ceil2(x,y) (x+y-1) / y

#ifndef ONLINE_JUDGE
#define debug(x) cout << #x <<" = "; print(x); cout << endl;
#else
#define debug(x)
#endif

bool iseven(ll n) {if ((n & 1) == 0) return true; return false;}

void print(ll t) {cout << t;}
void print(int t) {cout << t;}
void print(string t) {cout << t;}
void print(char t) {cout << t;}
void print(double t) {cout << t;}
void print(ld t) {cout << t;}

template <class T, class V> void print(pair <T, V> p);
template <class T> void print(vector <T> v);
template <class T> void print(set <T> v);
template <class T, class V> void print(map <T, V> v);
template <class T> void print(multiset <T> v);
template <class T, class V> void print(pair <T, V> p) {cout << "{"; print(p.ff); cout << ","; print(p.ss); cout << "}";}
template <class T> void print(vector <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T> void print(set <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T> void print(multiset <T> v) {cout << "[ "; for (T i : v) {print(i); cout << " ";} cout << "]";}
template <class T, class V> void print(map <T, V> v) {cout << "[ "; for (auto i : v) {print(i); cout << " ";} cout << "]";}

void solve()
{
    ll n; cin >> n;
    ll ans = floor(1.08*n);
    if(ans < 206){
        cout << "Yay!" << endl;
    }
    else if(ans == 206){
        cout << "so-so" << endl;
    }
    else{
        cout << ":(" << endl;
    }
}

signed main()
{
#ifndef ONLINE_JUDGE
    freopen("D:/Competitive Programming/input.txt", "r", stdin);
    freopen("D:/Competitive Programming/output.txt", "w", stdout);
#endif
    fastio;
    solve();
    return 0;
}

#include <algorithm>
#include <iostream>
#include <list>
#include <numeric>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <iterator>
#include <ostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <queue>
#include <cstdio>
using namespace std;

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

template<class T> string toString(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}
int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
long long toInt64(string s){long long r=0;istringstream sin(s);sin>>r;return r;}

string res;
string s;

int main() {
    ios::sync_with_stdio();
    cin.tie(0);
    cin>>s;
    string res;
    res = "";
    for(int i = 0; i < (int)s.size(); ++i){
        if(s[i] == '.'){cout<<res<<endl; return 0;}
        res += s[i];
    }
    cout<<res<<endl;
    return 0;
}


  #include<bits/stdc++.h>
  using namespace std;
  using ll = long long;
  #define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
  #define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
  #define repc(i,f,n) for(char i=(f); (i) <= (n); i++)
  //#define PI 3.14159265358979323846264338327950L
  #define debug(x) cout<<#x<<" :: "<<x<<"\n";
  #define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
  #define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
  #define Pl pair<ll, ll>
  #define OUT(x) cout << x << endl; return 0;
  #define ALL(x) (x).begin(),(x).end()
  #define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
  //printf("%.10f\n")
  //cout << fixed << setprecision(10);
  template<class T> inline bool chmax(T& a, T b){if (a < b) { a = b; return true; } return false;}
  template<class T> inline bool chmaxe(T& a, T b){if (a <= b) { a = b; return true; } return false;}
  template<class T> inline bool chmin(T& a, T b){if (a > b) { a = b; return true; } return false;}
  const ll MOD = 1000000007ll;
  const ll INF = 1e+18;
  const int iINF = 1e9;
  const double EPS = 1e-8;
  //const double PI = acos(-1.0);

struct sh
{
  ll D;
  ll C;
  ll S;
};

int
main()
{
  ll N; cin >> N;
  N *= 1.08;
  if(N ==206)cout << "so-so" << endl;
  else if(N > 206) cout << ":(" << endl;
  else cout << "Yay!" << endl;

}

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

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
const int maxn=2e5+10;

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;

ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}
ll expo(ll a, ll b, ll mod) {ll res = 1; while (b > 0) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b = b >> 1;} return res;}

ll mminvprime(ll a, ll b) {return expo(a, b - 2, b);}
bool revsort(ll a, ll b) {return a > b;}
void swap(int &x, int &y) {int temp = x; x = y; y = temp;}
ll combination(ll n, ll r, ll m, ll *fact, ll *ifact) {ll val1 = fact[n]; ll val2 = ifact[n - r]; ll val3 = ifact[r]; return (((val1 * val2) % m) * val3) % m;}
void google(int t) {cout << "Case #" << t << ": ";}
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, ll m) {a = a % m; b = b % m; return (((a + b) % m) + m) % m;}
ll mod_mul(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a * b) % m) + m) % m;}
ll mod_sub(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a - b) % m) + m) % m;}
ll mod_div(ll a, ll b, ll m) {a = a % m; b = b % m; return (mod_mul(a, mminvprime(b, m), m) + m) % m;}  //only for prime m
ll phin(ll n) {ll number = n; if (n % 2 == 0) {number /= 2; while (n % 2 == 0) n /= 2;} for (ll i = 3; i <= sqrt(n); i += 2) {if (n % i == 0) {while (n % i == 0)n /= i; number = (number / i * (i - 1));}} if (n > 1)number = (number / n * (n - 1)) ; return number;}
bool isPrime(ll n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (ll i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
    return true;
}
ll nextPrime(ll N)
{

    if (N <= 1)
        return 2;

    ll prime = N;
    bool found = false;
    while (!found) {
        prime++;

        if (isPrime(prime))
            found = true;
    }
    return prime;
}
bool palin(string s,ll i,ll j){
    if(i>j)
    	return false;
    while(i<j){
         if(s[i]!=s[j])
         	return false;
         i++;
         j--;
    }
    return true;
}

bool isperfect(lld x){
	if(x>=0){
		ll s=sqrt(x);
		return (s*s==x);
	}
	return false;
}

string correct(string s,ll k){
  string res;
  ll n=s.size();
  for(ll i=0;i<k;i++){
     res+=s[i%n];
  }
  return res;
}

int main() {
#ifndef ONLINE_JUDGE
     // for getting input from input.txt
     freopen("input1.txt", "r", stdin);
     // for writing output to output.txt
     freopen("output1.txt", "w" , stdout);
#endif

      fastio();
      	ll n;
        cin>>n;
        ll r=n*1.08;
        if(r==206)
          cout<<"so-so"<<'\n';
        else if(r<206)
          cout<<"Yay!"<<'\n';
        else
          cout<<":("<<'\n';

     return 0;
 }


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

int main() {
	int m, n;
	char a;
	cin >> m;
	cin >> n;
	for (int i = 0; i < m; i++) {
		cin >> a;
		if (a == 'o') {
			n++;
		}
		else {
			n--;
			if (n < 0)n++;
		}
	}
	cout << n << endl;
	return 0;
}

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

int main()
{

    ll x,n;
    cin>>n>>x;
    string mozi;
    cin >> mozi;
    rep(i,n){

        if (mozi.compare(i,1, "x") == 0)
        {
            if (x > 0)
            {
                x--;
            }
        }
        else{
                x++;
        }
    }
    cout<<x;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
ll a,b,kq;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>a>>b;
    f(i,1,a){
        f(j,1,b){
            kq+=i*100+j;
        }
    }
    cout<<kq;
}

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#include "atcoder/all"

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    int n;
    cin >> n;
    vector<ll> v(n);
    rep(i, n) cin >> v[i];
    ll g = v[0];

    for(ll l : v) g = __gcd(g, l);
    cout << g << endl;

}


#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int N=2e3+5;
const int mod=1e9+7;
ll read()
{
	ll c=getchar(),Nig=1,x=0;
	while(!isdigit(c)&&c!='-')c=getchar();
	if(c=='-')Nig=-1,c=getchar();
	while(isdigit(c))x=((x<<1)+(x<<3))+(c^'0'),c=getchar();
	return Nig*x;
}
ll gcd(ll a,ll b)//最大公约数
{
    return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)//最小公倍数
{
	return a*b/gcd(a,b);
}
ll quick_pow(ll x, ll n)//快速幂
{
    ll ans=x,dayult=1;
    dayult%=mod;
    while(n)
	{
        if(n&1)
        {
        	dayult=dayult*ans%mod;
        	n--;
		}
        ans=ans*ans%mod;
        n>>=1;
    }
    return dayult;
}
ll extra_gcd(ll a,ll b,ll &x,ll &y)//扩展欧几里得(递归)-求逆元
{
	if(!b)
	{
		x=1;
		y=0;
		return a;
	}
	ll exgcd=extra_gcd(b,a%b,y,x);
	y-=a/b*x;
	return exgcd;
}
ll n,m,c;
bool f[N][N];
ll dp[N][N];
ll x;
ll y[N];
ll z[N];
ll g[N];
int main()
{
	n=read();
	m=read();
	for(ll i=1;i<=n;i++)
	{
		string sz;
		cin>>sz;
		for(ll j=0;j<m;j++)
		if(sz[j]=='.')
		{
			f[i][j+1]=1;
		}
	}
	dp[1][1]=1;
	for(ll i=1;i<=n;i++)
	{
		x=0;
		for(ll j=1;j<=m;j++)
		{
				z[j]=g[j];
		}
		for(ll j=1;j<=m;j++)
		{
			if(i==1&&i==j)
			{
				x=1;
				y[1]=1;
				g[2]=1;
				continue;
			}
			if(f[i][j])
			{
				dp[i][j]=(y[j]+x+z[j])%mod;
				g[j+1]=(z[j]+dp[i][j])%mod;
				y[j]=(y[j]+dp[i][j])%mod;
				x=(x+dp[i][j])%mod;
			}
			else
			{
				dp[i][j]=0;
				x=y[j]=g[j+1]=0;
			}
		}
	}
	printf("%lld\n",dp[n][m]);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define X ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(2)<<(x)

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

// long long p = 1e9+7;

typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<int> VI;
typedef vector<pair<ll,ll>> VP;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<bool> VB;

// typedef pair<ll, ll> PL;
typedef unordered_map<ll, ll> UMP;
#define FOR(i,b,init) for(i=init;i<b;i++)
#define IFOR(i,b,init) for(i=b;i>=init;i--)
#define pb push_back
#define fi first
#define se second
#define mp make_pair

// typedef  unordered_set<ll>;

/////GLOABLS VARS
ll MOD = 1e9+7;
ll MOD1 = 998244353;
ll gmx = 1e6+7;

VL fact(gmx, 1);
//////FUNCTIONS
ll powp(ll val, ll deg)
{
    // debug(val, deg);
    if (!deg)
        return 1;
    if (deg & 1)
        return (powp(val, deg - 1) * val) % MOD;
    ll res = powp(val, deg >> 1);
    // debug(res);
    return (res * res) % MOD;
}
ll mx=1e5+7;
vector<VL> adj;
// vector<set<ll>> al(mx);
VL vis;
// ll c=1;

// set<ll> dfs(ll r){
//     if(adj[r].size()==0){al[r].insert(r);}
//     for(auto nb: adj[r]){
//         set<ll> leaves = dfs(nb);
//         for(auto leaf: leaves){
//             al[r].insert(leaf);
//         }
//     }

//     return al[r];
// }
bool dfs(ll r, ll parent){
    // debug()
    // if(igno[r]==1){return;}
    // debug(r,parent);

    if(vis[r]==1){return true;}
    if(vis[r]==2){return false;}
    vis[r]=1;
    for(auto k: adj[r]){
        if(dfs(k, r)){vis[r]=2;return true;}
    }
    vis[r]=2;
    return false;
}

//SPF
    // VL spf(mx,1);
    // FOR(i,mx,1){
    //     spf[i]=i;
    // }
    // // VL all_primes;
    // FOR(i,mx,2){
    //     if(spf[i]==i){
    //         // all_primes.pb(i);
    //         for(j=i*i;j<mx;j+=i){
    //             spf[j]=min(i, spf[j]);
    //         }
    //     }
    // }

//It is not easy but it can be fun, if you think!!!

ll gcd(ll a, ll b){
    // debug(a,b);
    if(a>b){swap(a,b);}
    if(a==0){return b;}
    return gcd(a, b%a);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    //     #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
    // #endif

    // ll tc,ori;
    // cin>>tc;
    // while(tc--){
        string s;
        // cin>>s;
        ll n,k,m,o,x,r,y,i,a,b,j;
        cin>>n>>m;
        cout<<n/m;
        // VL l(n);

    // }

}


#include<bits/stdc++.h>
using namespace std;
template<typename T>inline T read(){
	T f=0,x=0;char c=getchar();
	while(!isdigit(c)) f=c=='-',c=getchar();
	while(isdigit(c)) x=x*10+c-48,c=getchar();
	return f?-x:x;
}
namespace run{
	const int N=2e6+5,lim=309,mod=998244353,inv2=(mod+1)/2;
	inline int add(int x,int y){return x+y>=mod?x-mod+y:x+y;}
	inline int sub(int x,int y){return x>=y?x-y:x+mod-y;}
	inline int qpow(int x,int y){
		int ret=1;
		while(y){
			if(y&1) ret=1LL*x*ret%mod;
			x=1LL*x*x%mod,y>>=1;
		}
		return ret;
	}

	int C[lim][lim];
	inline void pre(int K){
		C[0][0]=1;
		for(int i=1;i<=K;i++){
			C[i][0]=1;
			for(int j=1;j<=i;j++) C[i][j]=add(C[i-1][j],C[i-1][j-1]);
		}
	}
	int n,a[N],K,sum[lim],pw[lim],ex[lim];
	int main(){
		n=read<int>(),K=read<int>(),pre(K);
		for(int i=1;i<=n;i++) a[i]=read<int>();

		for(int i=1;i<=n;i++){
			pw[0]=1;
			for(int k=1;k<=K;k++) pw[k]=1LL*pw[k-1]*a[i]%mod;
			for(int k=0;k<=K;k++) sum[k]=add(sum[k],pw[k]);
			pw[0]=1;
			for(int k=1;k<=K;k++) pw[k]=1LL*pw[k-1]*2%mod*a[i]%mod;
			for(int k=0;k<=K;k++) ex[k]=add(ex[k],pw[k]);
		}

		for(int k=1;k<=K;k++){
			int ans=0;
			for(int j=0;j<=k;j++)
				ans=(1LL*C[k][j]*sum[k-j]%mod*sum[j]+ans)%mod;
			ans=sub(ans,ex[k]),ans=1LL*ans*inv2%mod;
			printf("%d\n",ans);
		}
		return 0;
	}
}
int main(){
#ifdef my
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	return run::main();
}

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

typedef long long ll;
typedef unsigned long long ull;

#define mp make_pair
#define fr first
#define sc second
template<int MOD=1000000007>
struct modint{
	/*static modint inv[2005];
	static void init(){
		for(int i=0;i<2005;i++)inv[i]=modpow(modint(i),MOD-2);
	}*/
	ull val;
	modint(ull x){ val=x%MOD; }
	modint(){}
	friend modint modpow(modint x,ull k){
		modint ret(1ULL);
		while(k>0){
			if(k&1ULL)ret*=x;
			x*=x;
			k>>=1;
		}
		return ret;
	}
	modint& operator +=(const modint& rhs){
		this->val+=rhs.val;
		if(this->val>=MOD)this->val-=MOD;
		return *this;
	}
	friend modint operator+(modint lhs, const modint& rhs){
		lhs+=rhs;
		return lhs;
	}
	modint& operator -=(const modint& rhs){
		this->val+=MOD-rhs.val;
		if(this->val>=MOD)this->val-=MOD;
		return *this;
	}
	friend modint operator-(modint lhs, const modint& rhs){
		lhs-=rhs;
		return lhs;
	}
	modint& operator *=(const modint& rhs){
		this->val*=rhs.val;
		this->val%=MOD;
		return *this;
	}
	friend modint operator*(modint lhs, const modint& rhs){
		lhs*=rhs;
		return lhs;
	}
	modint& operator /=(const modint& rhs){
		(*this)*=modpow(rhs,MOD-2);
		//(*this)*=inv[rhs.val];
		return *this;
	}
	friend modint operator/(modint lhs, const modint& rhs){
		lhs/=rhs;
		return lhs;
	}
};
//template<int MOD>
//modint<MOD> modint<MOD>::inv[2005];

const int MOD=998244353;
typedef modint<MOD> mi;

int n,k;
mi a[200010];
mi s[200010];
mi fac[302];
mi ret_[200010];

int main(){
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++){
		int x;
		scanf("%d",&x);
		a[i]=x;
	}
	fac[0]=1;
	for(int i=1;i<=k;i++)fac[i]=fac[i-1]*i;
	for(int j=0;j<n;j++){
		mi p=1,q=1;
		for(int i=0;i<=k;i++){
			s[i]+=p;
			p*=a[j];
			ret_[i]+=q;
			q*=2*a[j];
		}
	}
	for(int i=0;i<=k;i++){
		s[i]/=fac[i];
	}
	for(int i=1;i<=k;i++){
		mi ret=0;
		for(int j=0;j<=i;j++){
			ret+=s[j]*s[i-j];
		}
		ret*=fac[i];
		ret-=ret_[i];
		ret/=2;
		printf("%d\n",(int)(ret.val));
	}
}


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

using namespace std;

int main(){
    int a;
    int b;
    cin >> a >> b;
    int tmp = (2 * (a) + 100);
    cout << tmp - b << endl;
    return 0;
}

#include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
#define int long long
#define ll long long
#define INF 1LL << 33
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define SHOW(p) \
    if (test)   \
        cout << #p " : " << p << endl;
bool test = true;
//bool test = false;
int B, C, n, ans;
signed main()
{
    cin >> B >> C;
    n = C / 2;
    if (C == 1) {
        if (B == 0) {
            ans = 1;
        } else {
            ans = 2;
        }
    } else if (C == 2) {
        if (B == 0) {
            ans = 2;
        } else {
            ans = 3;
        }
    } else if (B == 0) {
        if (C % 2 == 0) {
            ans = 2 * n;
        } else {
            ans = 2 * n + 1;
        }
    } else if (B > 0) {
        if (C % 2 == 0) {
            if (B - n > 0) {
                // |X| <= B
                ans = 2 * n + 1;
            } else {
                // |X| <= B
                ans = 2 * B + 1;
            }
            // |X| > B
            ans += 2 * n - 2;
        } else {
            if (B - n > 0) {
                // |X| <= B
                ans = 2 * n + 2;
            } else {
                // |X| <= B
                ans = 2 * B + 1;
            }
            // |X| > B
            ans += 2 * n - 1;
        }
    } else {
        if (C % 2 == 0) {
            // |X| <= B
            if (B + n >= 0) {
                ans = -2 * B + 1;
            } else {
                ans = 2 * n + 1;
            }
            // |X| > B
            ans += 2 * n - 1;
        } else {
            // |X| <= B
            if (B + n >= 0) {
                ans = -2 * B + 1;
            } else {
                ans = 2 * n;
            }
            ans += 2 * n;
        }
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define ll long long int
#define tc ll t;cin>>t;while(t--)
#define PI 2*acos(0)
#define mset(pq) memset(pq, 0, sizeof(pq));

ll M=1e9+7;

int sum_digit(int x) { int sum=0; while(x>0){ sum+=x%10; x/=10; } return sum; }
int reverse_num(int n){ int tmp=n, ans=0, r; while(tmp>0){ r=tmp%10; ans=ans*10+r; tmp/=10; } return ans; }
ll factorial(ll n){ ll i, ans=1; for(i=n; i>1; i--){ans*=i;} return ans; }
ll gcd(ll num1, ll num2) { ll a,b,r; a=num1; b=num2; r=a%b; while(r>0){ a=b; b=r; r=a%b; } return b; }
ll lcm(ll num1, ll num2) { return (num1*num2)/gcd(num1, num2); }

void solve()
{
    int n, m, a, b, c, d, x, y, z, p;

    cin >> a >> b;
    x = sum_digit(a);
    y = sum_digit(b);

    cout << max(x, y);
}

int main()
{
    //tc
    solve();
    return 0;
}

/*

*/
// reverse(s.begin(), s.end()); // reversing a string
// getline( cin, s);
/*
vector <int> arr;
for(i=0; i<n; i++)
    arr.push_back(i);
*/

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

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

  vector<int64_t> a(0);
  for(int64_t i=1; i*i<=N; i++){
    if(i*i == N){
      a.push_back(i);
      continue;
    }

    if(N%i == 0){
      a.push_back(i);
      a.push_back(N/i);
    }
  }

  sort(a.begin(),a.end());
  int64_t n=a.size();
  rep(i,n) cout << a[i] << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false)
#define rep(i, n) for(ll i=0; i<(ll)n; i++)
#define ALL(obj) begin(obj), end(obj)
typedef long long ll;
vector<vector<int> > G(22);
vector<int> color(22, -1), ts;
vector<bool> vis(22, 0);
int n, m, a, b;

void dfs(int now){
	ts.push_back(now);
	vis[now]=1;

	for(int i: G[now]){
		if(vis[i])
		    continue;

		dfs(i);
	}
}

ll DFS(int i){
	if(i==ts.size())
	    return 1;

	ll res=0;
    rep(j, 3){
    	bool f=1;
    	for(int x:G[ts[i]]){
    		if(color[x]==j){
    			f=0;
    			break;
			}
		}

		if(!f)
		   continue;

		color[ts[i]]=j;
		res+=DFS(i+1);
		color[ts[i]]=-1;
	}

	return res;
}

int main()
{
    IOS;
	cin>>n>>m;
	rep(i, m){
		cin>>a>>b;
		a--;
		b--;

		G[a].push_back(b);
		G[b].push_back(a);
	}

	ll ans=1;
	rep(i, n){
		if(vis[i])
		    continue;

		dfs(i);
		fill(ALL(color), -1);
		ans*=DFS(0);
		ts.clear();
	}

	cout<<ans<<endl;

	return 0;
}


#include <bits/stdc++.h>

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

  long long int i=1;
  long long int ans=0;
  bool flag=false;
  long long int N;
  cin >> N;
  while(flag==false){
    string str1 = to_string(i);
    string str2 = to_string(i);
    string str = str1+str2;
    long long int num = (long long int)stol(str);
    if(num<=N){
      ans++;
      i++;
    }else{
      flag = true;
    }
  }
  cout << ans;

}

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

#define int             long long
#define pb              push_back
#define ppb             pop_back
#define pf              push_front
#define ppf             pop_front
#define all(x)          (x).begin(), (x).end()
#define uniq(v)         (v).erase(unique(all(v)), (v).end())
#define sz(x)           (int)((x).size())
#define ff              first
#define ss              second
#define rep(i, a, b)    for(int i = a; i <= b; i++)
#define mem1(a)         memset(a, -1, sizeof(a))
#define mem0(a)         memset(a, 0, sizeof(a))
#define endl            "\n"
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;

const long long INF = 1e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;

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

void fast_io()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}

vi num;

void precompute() {

	for (int i = 1; i <= 6; i++) {
		int low = binpow(10, i - 1);
		int high = binpow(10, i) - 1;
		for (int j = low; j <= high; j++) {
			int tmp = j * binpow(10, i) + j;
			num.pb(tmp);
		}
	}
}

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

	auto it = upper_bound(all(num), n);

	int ind = it - num.begin();

	cout << ind << endl;

}

signed main()
{
	fast_io();
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t = 1;

	// cin >> t;
	precompute();

	while (t--) {

		solve();

	}
	return 0;

}


#include <bits/stdc++.h>
using namespace std;
#define tolowercase(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define touppercase(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define lsb(x) (x&(-x))
#define MOD 1000000007
#define ll long long
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define file_read(x,y) freopen(x, "r", stdin); \
                  freopen(y, "w", stdout);

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll x,y;
    cin>>x>>y;
    if(min(x,y)+3>max(x,y)) cout<<"Yes\n";
    else cout<<"No\n";
}

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

int main(){
	int A, B;
	cin>>A>>B;
	if(A<B&&A+3>B||B<A&&B+3>A) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define F                 first
#define S                 second
#define int               long long
#define pb                push_back
#define mp                make_pair
#define pii               pair<int,int>
#define vec               vector<int>
#define mii               map<int,int>
#define pqb               priority_queue<int>
#define no_of_test(zzz)   int zzz; cin>>zzz; while(zzz--)
#define p(c)              cout<<c<<'\n';
#define f(i,a,b)          for(int i=a;i<b;i++)
const int mod = 1e9 + 7;
int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//no_of_test(zzz)
	{
		int x,y;
        cin>>x>>y;
        int k=abs(x-y);
        if(k<3)
        cout<<"Yes"<<'\n';
        else
        {
            cout<<"No"<<'\n';
        }

	}
	return 0;
}
//cout<<"###"<<'\n';
//cout<<"."<<'\n';
//cout<<"****"<<'\n';
/*
NO
YES
NO
YES
NO
YES
*/

#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize(2)
typedef long long ll;
const int N=1e6+5;
const int inf=0x3f3f3f3f;
ll gcd(ll a,ll b)//最大公约数
{
    return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)//最小公倍数
{
	return a*b/gcd(a,b);
}
ll quick_pow(ll x, ll n)//快速幂
{
    ll num=x,ansult=1;
    while(n)
	{
        if(n%2)
            ansult*=num;
        num*=num;
        n/=2;
    }
    return ansult;
}
ll extra_gcd(ll a,ll b,ll &x,ll &y)//扩展欧几里得(递归)-求逆元
{
	if(!b)
	{
		x=1;
		y=0;
		return a;
	}
	ll exgcd=extra_gcd(b,a%b,y,x);
	y-=a/b*x;
	return exgcd;
}
int flag(int a)
{
	;
}
ll read()
{
	ll c=getchar(),Nig=1,x=0;
	while(!isdigit(c)&&c!='-')c=getchar();
	if(c=='-')Nig=-1,c=getchar();
	while(isdigit(c))x=((x<<1)+(x<<3))+(c^'0'),c=getchar();
	return Nig*x;
}
void out(int a)
{
    if(a > 9)
    {
        out(a/10);
    }
    putchar(a%10 + '0');
}
ll num[105],n;
void visit()
{
	for(int i=1;i<=n;i++)
	{
		cout<<num[i]<<" ";
	}
	cout<<endl;
}
void Del(int x)
{
	for(ll i=x;i<n;i++)
	{
		num[i]=num[i+1];
	}
	n--;

}
int main()
{
	ll x,y;
	x=read();
	y=read();
	if(abs(x-y)<3)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define fo(a,b,c) for(int a=b;a<c;a++)
#define int long long int
#define ff first
#define ss second
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int mod = 1e9 + 7;
const int cmod = 998244353;
const int N = 3e5 + 5;
const int inf = 1e18 + 2;
int power(int a,int b)
{
    if(b==0)
    return 1;
    else if(b%2==0)
    {
    int c=power(a,b/2);
    return (c*c)%mod;
    }
    else
    return ((a%mod)*(power(a,b-1)%mod))%mod;
}
void solve(int Case)
{
    vi v(3);
    fo(i,0,3)
    cin>>v[i];
    sort(v.begin(),v.end());
    if(v[1]-v[0]==v[2]-v[1])
    {
        cout<<"Yes";
        goto a;
    }
    sort(v.begin(),v.end(),greater<int>());
    if(v[1]-v[0]==v[2]-v[1])
    {
        cout<<"Yes";
        goto a;
    }
    cout<<"No";
    a:;
}
int32_t main()
{
    fastio
    int testcase = 1;
    //cin >> testcase;
    int Case = 1;
    while(testcase --)
    {
        solve(Case);
    }
    return 0;
}

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

int main(){

    int a, b, c;
    cin >> a >> b >> c;
    if(a > b) swap(a, b);
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    if(b - a == c - b) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

int main()
{
    string s;
    cin >> s;
    for (auto it = s.rbegin(); it != s.rend(); ++it) {
        char c = *it;
        if (c == '6' || c == '9') {
            c ^= '6' ^ '9';
        }
        cout << c;
    }
    cout << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mem(a,val) memset(a,(val),sizeof((a)))
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define decimal(n)  cout << fixed ; cout << setprecision((n));
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
#define all(v) v.begin(), v.end()
#define endl "\n"
#define lcm(m,n) (m)*((n)/__gcd((m),(n)))
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(ll (i)=1;(i)<(n);(i)++)
#define repa(i,n,a) for(ll (i)=(a);(i)<(n);(i)++)
#define repr(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define pll pair<ll,ll>
#define pii pair<int, int>
#define mll map<ll,ll>
#define vll vector<ll>
#define sz(x) (ll)x.size()
#define ub upper_bound
#define lb lower_bound
#define pcnt(x) __builtin_popcountll(x)
const long long N=10;
const long long NN=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;
template<typename T,typename T1>T maxn(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T minn(T &a,T1 b){if(b<a)a=b;return a;}

inline long long int mul(long long int a,long long int b){return (a*1LL*b)%M;}
inline long long int add(long long int a,long long int b){return (a+b)%M;}
inline long long int sub(long long int a,long long int b){return ((a%M-b%M)+M)%M;}
inline ll mod(long long int x,long long int p = M) {return (x < 0?(x%p)+p:x%p);}

long long int power(long long int b,long long int e,long long int m)
{
	if(e==0LL) return 1LL;
	if(e&1LL) return ((b%m)*(power((b*b)%m,e/2,m)))%m;
	return power((b*b)%m,e/2,m);
}

long long int modInverse(long long int A,long long int m)
{
    return power(A,m-2,m);
}

long long int fac[N+1],invfac[N+1];
void init()
{
    fac[0]=1;
    invfac[0]=1;
    for(long long int i=1;i<N+1;i++)
    {
        fac[i]=mul(fac[i-1],i);
    }
     for(long long int i=1;i<N+1;i++)invfac[i]=mul(invfac[i-1],modInverse(i,M));
}
long long int nCr(long long int n, long long int r)
{
    if(n<r)return 0LL;
    if (r==0)return 1LL;
    return mul(mul(fac[n],invfac[r]),invfac[n-r]);
}
void solve()
{
  //code begins from here//
  init();
  string s;
  cin>>s;
  ll o=0,x=0,q=0;
  rep(i,sz(s))
  {
    if(s[i]=='x')x++;
    else if(s[i]=='o')o++;
    else q++;
  }
  ll ans=0;
  if(o==4)
  {
    ans=fac[4];
  }
  else if(o==3)
  {
    ans=q*fac[4]+3*(24/2);
  }
  else if(o==2)
  {
    ans=((q*(q-1))/2)*24+q*3*(12)+2*(4)+(6);
  }
  else if(o==1)
  {
    ans=1+q*(2*(fac[4]/fac[3])+(fac[4]/4))+nCr(q,2)*3*(fac[4]/fac[2])+nCr(q,3)*fac[4];
  }
  else if(o==0)
  {
    if(q)ans=pow(q,4);
  }
  cout<<ans;
}

signed main()
{
FAST
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int testcase=1;
//cin>>testcase;
while(testcase--) solve();
return 0;
}


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

#define IOS ios::sync_with_stdio(false); cin.tie(0);cout.tie(0)

const int P = 1e9 + 7;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int N = 3e6 + 10;

int main()
{
	IOS;
	int n;
	string str;
	vector<int> v;
	cin >> str >> n;

	for(auto x : str)
		if(x >= '0' && x <= '9') v.push_back((int)(x - '0'));
		else v.push_back((int)(10 + x - 'A'));

	vector<vector<int> > f(str.size() + 1, vector<int>(18, 0));

	int state = 0;
	for(int i = 0; i < (int)str.size(); ++ i)
	{
		for(int j = 1; j <= 16; ++ j)
		{
			f[i + 1][j] = (f[i + 1][j] + (LL)f[i][j] * j % P) % P;
			f[i + 1][j + 1] = (f[i + 1][j + 1] + (LL)f[i][j] * (16 - j) % P) % P;
		}
		f[i + 1][1] = (f[i + 1][1] + (LL)f[i][0] * 15 % P) % P;
		f[i + 1][0] = (f[i + 1][0] + f[i][0]) % P;
		for(int j = 0; j < v[i]; ++ j)
		{
			int nstate = state;
			if(i || j) nstate |= (1 << j);
			f[i + 1][__builtin_popcount(nstate)] += 1;
		}
		state |= (1 << v[i]);
	}

	int res = f[str.size()][n] + (__builtin_popcount(state) == n);
	cout << res << endl;

	return 0;
}

#include <cstdio>
#include <iostream>
using namespace std;
typedef long long LL;
const int mod = 1e9 + 7;
const int L = 2e5 + 100;
const int K = 16 + 4;

char lmt[L]; int lp;
long long f[L][K];
bool has[L]; int cnt;

int n, k;

int main() {
	char in = getchar();
	while((in < '0' || in > '9') && (in < 'A' || in > 'F')) in = getchar();
	while((in >= '0' && in <= '9') || (in >= 'A' && in <= 'F')) {
		lmt[++lp] = (in < 'A') ? (in - '0') : (in - 'A' + 10);
		in = getchar();
	}
	scanf("%d", &k);
		f[1][1] = max(0, lmt[1] - 1);
		for(int i = 2; i <= lp; ++i)
			f[i][1] = 15;

		for(int i = 1; i <= lp; ++i) {
			if(!has[lmt[i]]) ++cnt;
			has[lmt[i]] = true;
			for(int j = 01; j <= 16; ++j) {
				f[i + 1][j] += f[i][j] * j;
				f[i + 1][j] %= mod;
				f[i + 1][j + 1] += f[i][j] * (16 - j);
				f[i + 1][j + 1] %= mod;
			}
			for(int k = 0; k < lmt[i + 1]; ++k) {
				f[i + 1][cnt] += has[k];
				f[i + 1][cnt] %= mod;
				f[i + 1][cnt + 1] += !has[k];
				f[i + 1][cnt + 1] %= mod;
			}
		}
	cout << (f[lp][k] + (cnt == k)) % mod;
	return 0;
}


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

int main() {
  int n;
  cin >> n;
  int x, cnt = 0;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    flag = false;
    x = i;
    while (x) {
      if (x % 10 == 7) {
        flag = true;
        break;
      } else {
        x /= 10;
      }
    }
    if (flag) continue;
    x = i;
    while (x) {
      if (x % 8 == 7) {
        flag = true;
        break;
      } else {
        x /= 8;
      }
    }
    if (flag) continue;
    cnt++;
  }
  cout << cnt << endl;
}


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

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

    int N,S,D; cin >> N >> S >> D;
    rep(i,N){
        int X,Y; cin >> X >> Y;
        if(X < S && Y > D){ cout << "Yes" << endl; return 0; }
    }
    cout << "No" << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define fr(i,t) for(i=0;i<t;i++)
#define fr1(i,r,t) for(i=r;i<t;i++)
typedef long long int lli;
typedef unsigned long long int ulli;
#define inf LONG_MAX
#define ff first
#define ss second
double pie=3.14159265358979323846;
#define dbug(x) cout<<#x<<"="<<x<<endl
#define dbug2(x,y)
lli M=1e9+7;
// lli M=998244353;
#define gg cout<<"Case #"<<i+1<<": "
#define exact(x) cout<<fixed<<setprecision(8)<<x<<endl
#define ceil(x,y) (x+y-1)/y
#define all(x) (x).begin(),(x).end()
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lli T,n,i,j,k=0,m,j1,co=0,check,mi,l,sum;
    lli ans=0;
    // cin>>T;
    // fr(i,T)
    // {
        lli x,y;
        cin>>n>>x>>y;
        lli a[n],b[n];
        fr(j,n) cin>>a[j]>>b[j];
        co=0;
        fr(j,n)
        {
            if(a[j]<x&&b[j]>y) co=1;
        }
        if(co==0) cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    // }
}


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

const int N = 2005;

int n, m, fa[N], ans1, ans2, siz[N];
char a[N][N];

int find_(int x) {
	return x == fa[x] ? x : fa[x] = find_(fa[x]);
}

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n + m; i++)
		fa[i] = i, siz[i] = 1;
	for (int i = 1; i <= n; i++)
		scanf("%s", a[i] + 1);
	a[1][1] = a[n][1] = a[1][m] = a[n][m] = '#';
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++)
			if (a[i][j] == '#') {
				int x = find_(i), y = find_(j + n);
				if (x^y)
					fa[x] = y, siz[y] += siz[x];
			}
	for (int i = 1; i <= n + m; i++)
		if (find_(i) == i)
			ans1 += (i <= n)|(siz[i] >= 2), ans2 += (i > n)|(siz[i] >= 2);
	printf("%d\n", min(ans1, ans2) - 1);
}

#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; using ll = long long; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

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

    vv<int> cond(N);
    rep(i, M) {
        cond[X[i] - 1].push_back(i);
    }

    vector<int> xsort(M);
    iota(xsort.begin(), xsort.end(), 0);
    sort(xsort.begin(), xsort.end(), [&](int l, int r) { return X[l] < X[r]; });

    vv<ll> dp = vvec(N + 1, 1 << N, 0LL);
    dp[0][0] = 1;
    rep(i, N) {
        rep(bit, 1 << N) {
            rep(j, N) {
                if (bit >> j & 1) continue;
                int nbit = bit | 1 << j;
                bool ok = true;
                for (int ci : cond[i]) {
                    int y = nbit & ((1 << Y[ci]) - 1);
                    int z = __builtin_popcount(y);
                    if (z > Z[ci]) {
                        ok = false;
                        break;
                    }
                }
                if (ok) {
                    dp[i + 1][nbit] += dp[i][bit];
                }
            }
        }
    }
    write(dp[N][(1 << N) - 1]);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll gcd(ll a, ll b){return b? gcd(b, a % b): a;}
ll quickpow(ll a, ll b){ll res = 1; while(b){if (b & 1) res = res * a; a = a * a; b >>= 1;} return res;}
// head

const int N = 2e5 + 5, mod = 998244353;
int n, m;
int dp[20][N], c[N][20];

int main(void){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> m;
	c[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		c[i][0] = 1;
		for (int j = 1; j <= 20; j++) {
			c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
		}
	}
	for (int i = 1; i <= m; i++) dp[1][i] = 1;
	for (int i = 1; i <= 18; i++) {
		for (int j = 1; j <= m; j++) {
			for (int k = j + j; k <= m; k += j) {
				dp[i + 1][k] += dp[i][j];
				dp[i + 1][k] %= mod;
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= 19; i++) {
		int cnt = 0;
		for (int j = 1; j <= m; j++) {
			cnt += dp[i][j];
			cnt %= mod;
		}
		ans += 1ll * cnt * c[n - 1][i - 1] % mod;
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define sz(v) (int)v.size()
#define all(v) v.begin(), v.end()
void dbg_out() { cerr << "\b\b]\n"; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T){ cerr << H << ", "; dbg_out(T...);}
#define watch(...) cerr << "[" << #__VA_ARGS__ << "]: [", dbg_out(__VA_ARGS__)

const int N = 4e5 + 5;
const int mod = 998244353;
vector <ll> fac(N+2), reFac(N+2);

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

void calc() {
    fac[0] = 1;
    for (int i = 1; i <= N; ++i)
        fac[i] = (fac[i-1] * i) % mod;

    reFac[N] = power(fac[N], mod-2);
    for (int i = N; i > 0; --i){
        reFac[i-1] = (reFac[i] * i) % mod;
    }
}

ll modMul(ll a, ll b) {
    if (a >= mod) a %= mod;
    if (b >= mod) b %= mod;
    return (a * b) % mod;
}

ll nCr(ll a, ll b) {  //nCr => C(n, r)
    if (a < 0 or b < 0 or a < b) return 0LL;
    return modMul(fac[a], modMul(reFac[b], reFac[a - b]));
}

vector <int> factor(N); //factor[i] => smallest prime factor of i

void linear_seive() {
    vector <int> primes;

    for (int i = 2; i < N; ++i) {
        if (factor[i] == 0) {
            factor[i] = i;
            primes.push_back(i);
        }
        for (int j = 0; j < sz(primes) and primes[j] <= factor[i] and primes[j] * i < N; ++j) {
            factor[i * primes[j]] = primes[j];
        }
    }
}

map <int, int> factorize(int n) {
    map <int, int> cnts;
    while (n > 1) {
        cnts[factor[n]]++;
        n /= factor[n];
    }
    return cnts;
};

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

    calc();
    linear_seive();

    int n, m; cin >> n >> m;
    ll ans = 0;
    for (int i = 1; i <= m; ++i) {
        map <int, int> cnts = factorize(i);
        ll tot = 1;
        for (auto j: cnts) {
            tot *= nCr(j.second + n - 1, n-1);
            tot %= mod;
        }
        ans += tot;
        ans %= mod;
    }

    cout << ans;

    return 0;
}

/*
 * Put the values of A[n-1] => {1...m}, for each value of A[n-1], calculate the number of sequences.
 * How to calculate them?
 * Use Binomial Coeff / Stars and Bars.
 * Since we have fixed the A[n-1] element, we have remained n-1 elements.
 * A[n-1] as: for each 'i', 1 <= i <= m, calculate the prime factorization of 'i' suppose: p^a * q^b.
   then, using stars and bars: nCr(a+n-1, n-1) * nCr(b+n-1, n-1).
   So answer is: 1 <= i <= m, summation(nCr(cnts(p) + n-1, n-1)), p => prime factor of 'i', cnts(p) => occurence of 'p' in 'i'

*/


#include<iostream>
using namespace std;
int main(){
	int n,a,b;
	cin>>n>>a>>b;
	cout<<n-a+b<<endl;
	return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n, a, b;
  cin >> n >> a >> b;
  n -= a;
  n += b;
  cout << n << endl;
  return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <numeric>
#include <cassert>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

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

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

ll n;

void dfs(vector<bool> used, map<char, int> m, ll d)
{
    if (d == n)
    {
        return;
    }

    for (int i = 0; i < 10; i++)
    {
    }
}

int main(void)
{
    vector<string> s(3);
    cin >> s[0] >> s[1] >> s[2];

    set<char> se;
    map<char, int> m;

    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < s[i].size(); j++)
        {
            se.insert(s[i][j]);
            m[s[i][j]] = -1;
        }
    }

    n = se.size();

    if (n > 10)
    {
        cout << "UNSOLVABLE" << endl;
        return 0;
    }

    vector<ll> v(10);

    for (int i = 0; i < 10; i++)
    {
        v[i] = i;
    }

    do
    {
        ll k = 0;

        for (auto &&i : m)
        {
            i.second = v[k];
            k++;
        }

        // for (auto &&i : m)
        // {
        //     cout << i.first << " " << i.second << endl;
        // }

        vector<ll> x(3, 0);

        bool flag = true;

        for (int i = 0; i < 3; i++)
        {
            ll ten = 1ll;

            for (int j = s[i].size() - 1; j >= 0; j--)
            {
                if (j == 0)
                {
                    if (m[s[i][j]] == 0)
                    {
                        flag = false;
                        break;
                    }
                }

                x[i] += ten * m[s[i][j]];
                ten *= 10ll;
            }
        }

        if (x[0] + x[1] != x[2])
        {
            flag = false;
        }

        if (flag)
        {
            for (int i = 0; i < 3; i++)
            {
                cout << x[i] << endl;
            }

            return 0;
        }

    } while (next_permutation(v.begin(), v.end()));

    cout << "UNSOLVABLE" << endl;
}

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

int A,B,W;

int main(){
  cin>>A>>B>>W;
  int m=1e9,M=0;
  for(int n=1;n<=1000000;n++){
  if(A*n<=1000*W && 1000*W<=B*n){
  m=min(m,n);
  M=max(M,n);
  }
  }
  if(M==0) cout<<"UNSATISFIABLE";
  else cout<<m<<" "<<M;

}


#include <bits/stdc++.h>
#ifdef LILY
#include "Debug.h"
#else
#define var(...) (0)
#define dbg(...) (0)
#endif
using int32 = int;
using int64 = long long;
using namespace std;

class Solution
{
#define int int32
#define sfor(i, n) for (int i = 1; i <= (n); ++i)
#define tfor(i, n) for (int i = 0; i < (n); ++i)
#define INF 0x3f3f3f3f
#define EPS 1e-5

    double a, b;
    int res = 1;

    void reals()
    {
        int dist = b - a;
        for (res = dist; res > 1; res--)
        {
            double left = a / res, right = b / res;
            if ([&]() {
                int cnt = 0;
                for (int j = ceil(left); j <= right; j++)
                    if (++cnt == 2) return true;
                return false;
            }())
            {
                return;
            }
        }
    }

public:
    Solution()
    {
        cin >> a >> b;
        reals();
        cout << res << endl;
    }
#undef int
#undef tfor
#undef sfor
};

int32 main()
{
#ifdef LILY
    while (1)
#endif
        Solution();
    return 0;
}

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

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

int main(void) {
	int A, B, ans = 1;

	cin >> A >> B;
	for (int i = 1; i <= B; i++) {
		if (floor(B / i) - floor((A - 1) / i) >= 2) {
			ans = i;
		}
	}

	cout << ans << endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 998244353;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n, w[101], ex[101], sm, dp[2][100 * 101][101];

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

    cin >> n;
    zep(i, 0, n)cin >> w[i];

    ex[0] = 1;
    rep(i, 1, n)ex[i] = i * ex[i - 1] % MOD;

    zep(i, 0, n)sm += w[i];
    if(sm % 2 == 1){print(0) return 0;}

    dp[0][0][0] = 1;
    zep(i, 0, n){
        memset(dp[(i + 1) % 2], 0, sizeof(dp[(i + 1) % 2]));

        rep(j, 0, sm / 2){
            rep(k, 0, i){
                dp[(i + 1) % 2][j][k] += dp[i % 2][j][k];
                dp[(i + 1) % 2][j][k] %= MOD;
                dp[(i + 1) % 2][j + w[i]][k + 1] += dp[i % 2][j][k];
                dp[(i + 1) % 2][j + w[i]][k + 1] %= MOD;
            }
        }
    }

    ll ans = 0;
    zep(k, 1, n){
        ans += dp[n % 2][sm / 2][k] * (ex[k] * ex[n - k] % MOD) % MOD;
        ans %= MOD;
    }
    print(ans)

    return 0;
}

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

const long long int MOD = 998244353;

void solve() {
	int n; cin >> n;
  	vector<int> a(n);
  	long long int sum = 0;
  	for (int i = 0; i < n; i++) {
    	cin >> a[i];
      	sum += a[i];
    }

  	if (sum % 2) {
    	cout << 0;
      	return;
    }

    vector<long long int> f(n + 1, 1);
  	vector<vector<long long int>> dp(sum + 1, vector<long long int>(n + 1, 0));
  	dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
        f[i] = f[i - 1] * i % MOD;

    for (int i = 0; i < n; i++) {
        for (int j = n; j > 0; j--) {
            for (int k = sum; k >= a[i]; k--) {
                dp[k][j] += dp[k - a[i]][j - 1];
                dp[k][j] %= MOD;
            }
        }
    }

    long long int ans = 0;
    for (int i = 0; i <= n; i++) {
        ans += dp[sum / 2][i] * f[i] % MOD * f[n - i] % MOD;
        ans %= MOD;
    }
    cout << ans;
}

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

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


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

int main() {
	int n;
	cin >> n;
	vector<int> a(n),b(n);
	rep(i, n)cin >> a[i];
	sort(a.begin(), a.end());
	rep(i, n)b[i] = i + 1;
	rep(i, n) {
		if (a[i] != b[i]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const int MOD = 1e9 + 7;
//const int ULTRA = 1e14;
const int PROMAX = 1e6 + 5;
const int PRO = 1e5 + 5;

#define ll long long
#define int ll
#define all(x) x.begin(), x.end()
#define lla(x) x.rbegin(), x.rend()
#define pb push_back
#define ThinkTwice ios_base::sync_with_stdio(false); cin.tie(NULL);
int    dx[] = {-1,  0,  1,  0, -1, -1,  1,  1};
int    dy[] = { 0,  1,  0, -1, -1,  1,  1, -1};
char  dir[] = {'U','R','D','L'};
inline int powmod(int a, int b, int mod) {int res=1; while(b>0) {if(b&1) res=(res*a)%mod; a=(a*a)%mod; b>>=1; } return res;}
inline int power(int a, int b) {int res=1; while(b>0) {if(b&1) res*=a; a*=a; b>>=1;} return res; }
//__________________________________________________________________

void solve() {
    char a, b, c; cin>>a>>b>>c;
    if(a == b && b == c) cout<<"Won\n";
    else cout<<"Lost\n";
}

signed main() {
	ThinkTwice
	int t;

	t = 1;
//	cin>>t;

	for(int i = 1; i<=t; i++) {
//		cout<<"Case "<<i<<": ";
		solve();
	}
}

//__________________________________________________________________
/*
Sample Input:

Sample Output:

*/


// Created by Priyanshu

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

#define M                    1000000007
#define pi                   3.14159265358979323846
#define ll                   long long
#define lld                  long double

// Pair
#define pii                  pair<int, int>
#define pll                  pair<ll, ll>

// Vector
#define vl                   vector<ll >
#define vi                   vector<int>
#define vpi                  vector<pii>
#define vpl                  vector<pll>
#define pb                   push_back
#define mp                   make_pair

// Search
#define lb                   lower_bound
#define ub                   upper_bound
#define mina                 *min_element
#define mama                 *max_element
#define bsrch                binary_search

////////
#define F                    first
#define S                    second
#define cel(x,a)             (((x) + (a) - 1) / (a))
#define all(v)               v.begin(), v.end()
#define countofbits(n)       __builtin_popcountll(n)
#define lcm(m, n)            (((m) / __gcd((m), (n)))*(n))
#define oset                 tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define deb(...)             cout << "(" << #__VA_ARGS__ << "):", dbg(__VA_ARGS__)
#define ms(arr, v)           memset(arr, v, sizeof(arr))
#define pf(x,y)              setfill('x')<<setw(y)
#define ps(x,y)              fixed << setprecision(y) << x
#define _X_                  ios_base::sync_with_stdio(false); cin.tie(NULL)

///////////////////////////////

int II;
long long I_O;
char CC, SS[20];
const int N = 1e5 + 4;

///////////////////////////////

// Input / Output
#define scn(str)             scanf("%s", str)
#define pri(str)             printf("%s\n", str)
#define inp(a, n)            for(int Ele=0; Ele<(n); Ele++)a[Ele]=read()
#define inp1(a, n)           for(int Ele=1; Ele<=(n); Ele++)a[Ele]=read()
inline  ll  read()           { II = 1, I_O = 0; while (!isdigit(CC = getchar())) if (CC == '-') II = -1; while (isdigit(CC)) I_O = I_O * 10 + CC - '0', CC = getchar(); return I_O * II;}
inline void wonl()           { putchar('\n');}
inline void  wws()           { }
inline void  dbg()           { cout << endl; }
inline void ww(ll k)         { if (k < 0) putchar('-'), k *= -1; II = 0; while (k)SS[++II] = k % 10, k /= 10; if (!II) SS[++II] = 0; while (II)putchar(SS[II--] + '0');}
inline void ww(pll p)        { ww(p.F), putchar(' '), ww(p.S); }

// bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {return (a.S < b.S);}

// struct compare {
//     bool operator()(const pair<int, int>& value, const int& key) {return (value.F < key);}
//     bool operator()(const int& key, const pair<int, int>& value) {return (key < value.F);}
// };

template <typename T, typename... V>
inline void wonl(T t, V... v) {ww(t); if (sizeof...(v))putchar(' '); wonl(v...);}

template <typename T, typename... V>
inline void  wws(T t, V... v) {ww(t); putchar(' '); wws(v...);}

template <typename T, typename... V>
inline void  dbg(T t, V... v) {cout << ' ' << t; dbg(v...);}

// always type cast before using v.size()

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve() {

    int ar[3];
    inp(ar, 3);
    sort(ar, ar + 3);

    wonl(ar[1] + ar[2]);

}

int main()
{
    // _X_;
    // clock_t time_req = clock();

    solve();

    // time_req = clock() - time_req;
    // cout << (float)time_req / CLOCKS_PER_SEC;
    return 0;
}

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

int main()
{
    int a, b, c, Max1, Max2;
    cin >> a >> b >> c;
    Max1 = max(a+b, b+c);
    Max2 = max(c+a, Max1);
    cout << Max2 << endl;
}


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

#ifdef Dhiraj
    #include "D:/dhiraj/Programming/debug.h"
#else
    #define d(...) 11
    #define cerr if(0) cerr
#endif

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

template <typename T, typename U>
inline istream& operator >> (istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}
template <typename T>
inline istream& operator >> (istream& in, vector<T>& v) {
    for(T& x : v) in >> x;
    return in;
}

const ll INF = 1e10;
const ll N = 1e5 + 1;
const ll K = 17 + 1;

ll n, m, k;
vector<ll> g[N];
ll c[K];
ll dis[K][N];
ll dp[1ll << K][K];

void bfs(ll id)
{
    vector<bool> vis(n + 1, 0);
    vis[c[id]] = true;

    for(ll i = 0; i <= n; i++) {
        dis[id][i] = INF;
    }

    queue<ll> q;
    q.push(c[id]);

    dis[id][c[id]] = 0;
    while(!q.empty())
    {
        ll u = q.front();
        q.pop();

        for(ll v : g[u])
        {
            if(!vis[v])
            {
                vis[v] = true;
                dis[id][v] = dis[id][u] + 1;
                q.push(v);
            }
        }
    }
}

ll f(ll mask, ll u)
{
    if(mask == (1ll << (k + 1)) - 2) return 0;
    ll &ans = dp[mask][u];
    if(ans != -1) return ans;
    ans = INF;
    for(ll v = 1; v <= k; v++)
    {
        if((mask & (1ll << v)) == 0) {
            ans = min(ans, dis[u][c[v]] + f(mask | (1ll << v), v));
        }
    }
    return ans;
}

void solve(int &tc)
{
    cin >> n >> m;
    for(ll i = 0; i <= n; i++) {
        g[i].clear();
    }

    for(ll i = 0; i < m; i++)
    {
        ll x, y;
        cin >> x >> y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    cin >> k;
    for(ll i = 1; i <= k; i++) {
        cin >> c[i];
        bfs(i);
    }

    memset(dp, -1, sizeof(dp));

    ll ans = INF;
    for(ll i = 1; i <= k; i++) {
        ans = min(ans, 1 + f(1ll << i, i));
    }
    if(ans == INF) ans = -1;
    cout << ans << endl;
}

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt", "r", stdin);
        freopen("D:/dhiraj/Programming/o1.txt", "w", stdout);
        freopen("D:/dhiraj/Programming/e1.txt", "w", stderr);
    #endif

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

    int tc = 1;
    for(int i = 1; i <= tc; i++) {
        cerr << "Case #" << i << "\n";
        solve(i);
    }
    return 0;
}

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

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FOR1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define FORI(i, n) for(int (i)=n-1; (i)>=0; (i)--)
template<class T, class U> void umin(T& x, const U& y){ x = min(x, (T)y);}
template<class T, class U> void umax(T& x, const U& y){ x = max(x, (T)y);}
template<class T, class U> void init(vector<T> &v, U x, size_t n) { v=vector<T>(n, (T)x); }
template<class T, class U, typename... W> void init(vector<T> &v, U x, size_t n, W... m) { v=vector<T>(n);  for(auto& a : v) init(a, x, m...); }

int n, m, k;
vector<vector<int>> edges;
vector<int> c;
vector<int> vis;
vector<int> d;

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);
    cin >> n >> m;
    edges.resize(n+1);
    FOR(i, m){
        int u, v;
        cin >> u >> v;
        edges[u].push_back(v);
        edges[v].push_back(u);
    }
    cin >> k;
    c.resize(k);
    FOR(i, k) cin >> c[i];

    vector<vector<int>> dist(k, vector<int>(k));
    for (int i = 0; i < k; i++){
        vector<int> d(n+1, -1);
        d[c[i]] = 0;
        queue<int> Q;
        Q.push(c[i]);
        while (!Q.empty()){
            int v = Q.front();
            Q.pop();
            for (int w : edges[v]){
                if (d[w] == -1){
                    d[w] = d[v] + 1;
                    Q.push(w);
                }
            }
        }
        for (int j = 0; j < k; j++){
            dist[i][j] = d[c[j]];
        }
    }

    int K = 1<<k;
    const int inf = 1e9;
    vector<vector<int>> dp;
    init(dp, inf, K, k);
    FOR(i, k) dp[1<<i][i] = 0;
    FOR(mask, K){
        FOR(i, k){
            if ((mask & (1<<i))){
                int mask2 = mask ^ (1<<i);
                FOR(j, k){
                    if ((mask2 & (1<<j)) && dist[j][i] != -1){
                        umin(dp[mask][i], dp[mask2][j] + dist[j][i]);
                    }
                }
            }
        }
    }
    int sol = inf;
    FOR(i, k) umin(sol, dp[K-1][i]);
    cout << (sol < inf ? sol+1 : -1) << endl;

    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}


#include <bits/stdc++.h>
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define forx(i,x,n) for(int i=x;i<(int)n;i++)
#define ce(e,i,n) cout<<e<<" \n"[i==(int)n-1];
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int N=5e2+2;
//int a[N][N],vis[N][N],dr[4]={1,0,-1,0},dc[4]={0,1,0,-1},n,m;
int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//   = 0 -  [i] {} '\n'  p  _  ? ^
	int n,q,t;
	ll mn=-1e15,mx=1e15,s=0,x,a;
	cin>>n;
	forn(i,n){
		cin>>a>>t;
		if(t==1)mn+=a,mx+=a,s+=a;
		else if(t==2)mn=max(mn,a),mx=max(mx,a);
		else mn=min(mn,a),mx=min(mx,a);
	}
	cin>>q;
	forn(i,q)cin>>x,cout<<min(mx,max(mn,x+s))<<'\n';
}

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

int main(){
  int n;cin>>n;
  vector<ll>ae(n+1,0),be(n+1,0),b(n+1);
  int tmp;
  for(int i=0;i<n;i++){
    cin>>tmp;
    ae.at(tmp)++;
  }
  for(int i=1;i<=n;i++){
    cin>>b.at(i);
    be.at(b.at(i))=1;
  }
  ll ans=0;
  for(int i=0;i<n;i++){
    cin>>tmp;
    ans+=ae.at(b.at(tmp))*be.at(b.at(tmp));
  }
  cout<<ans<<endl;
}


#include <bits/stdc++.h>
#define int long long
// #define m 1000000007
// #define piii pair<pair<int,int>>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

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

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

	}
	int mx1=a[0]*b[0],mx=0;
	for(int i=0;i<n;i++){
		if(a[i]>mx) mx=a[i];
		if(b[i]*mx>mx1) {mx1=b[i]*mx;
		cout<<mx1<<"\n";}
		else
			cout<<mx1<<"\n";
	}
}

int32_t main(){
	fast
	// int t;
	// cin>>t;
	// while(t--){
		solve();
		// cout<<"\n";
	// }
	return 0;
}

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

int main()
{
  int M;
  cin >> M;
  vector<int> vec(M);
  for (int i = 0; i < M; i++)
  {
    cin >> vec.at(i);
    // cout << vec.at(i) << endl;
  }

  vector<int> prime({2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47});
  uint64_t answer = -1;

  for (uint16_t i = 0; i <= 0b0111111111111111; i++)
  // uint16_t i = 0b0111111111111111;
  {
    bool c1 = true;
    // 全ての入力
    for (size_t j = 0; j < vec.size(); j++)
    {
      // 全ての素数
      int c2 = false;
      for (size_t k = 0; k < 15; k++)
      {
        if (i & 0b1 << k)
        {
          // 一つでも割り切れる
          if (vec[j] % prime[k] == 0)
          {
            c2 = true;
            break;
          }
        }
      }
      // cout << c2 << endl;
      if (!c2)
      {
        // 一つも割り切れない
        c1 = false;
        break;
      }
    }
    // 全ての入力に置いて何かしら割り切れる
    if (c1)
    {
      uint64_t kouho = 1;
      for (size_t k = 0; k < 15; k++)
      {
        if (i & 1 << k)
        {
          kouho *= prime[k];
        }
      }
      if (kouho < answer)
        answer = kouho;
    }

    // kouho *= prime[j];
    // bool tmp = true;
    // for (size_t j = 0; j < prime.size(); j++)
    // {
    //   if(prime[j]%kouho)
    // }
    // if (tmp)
  }

  cout << answer;
}


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

void solve(void)
{
    vector<int> v(3);
    rep(i, 3) cin >> v[i];
    map<int, int> mp;
    rep(i, 3) mp[v[i]]++;
    bool f = false;
    for (auto i : mp)
    {
        if (i.second >= 2)
            f = true;
        if (i.second >= 3)
        {
            cout << i.first << endl;
            return;
        }
    }

    if (f)
        for (auto i : mp)
        {
            if (i.second < 2)
            {
                cout << i.first << endl;
                return;
            }
        }
    else
        cout << 0 << endl;
}

int main(void)
{
    solve();
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb emplace_back
#define desend(x) greater<x>()
#define srt(v) sort(v.begin(),v.end())
#define all(x) x.begin(),x.end()
#define rvs(x) reverse(x.begin(),x.end())
#define Input(x) for(auto &n:x) cin>>n;
#define Output(x) for(auto &n:x) cout<<n<<" ";cout<<"\n";

ll power(ll x,ll y){//for (x^y)%mod Iterative
    ll ans=1;
    while(y>0){
        ans%=mod;
        if(y&1)ans*=x;
        x=x*x%mod;
        y>>=1;
    }
    return ans%mod;
}

ll fact(ll n){
    ll ans=1;
    for(ll i=1;i<=n;i++){
        ans*=i;
        ans%=mod;
    }
    return ans;
}

void solve(){
    ll a,b,c;
    cin>>a>>b>>c;
    map<ll,ll> ma;
    ma[a]++;
    ma[b]++;
    ma[c]++;
    if(ma.size()==3)cout<<0;
    else {
        if(ma.size()==1)cout<<a;
        else {
            for(auto it:ma)if(it.second==1)cout<<it.first;
        }
    }

}

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


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

#define rep(i,n) for(int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define v(T) vector<T>
#define imposs {cout<<"-1\n";return 0;}
#define LL_MAX LLONG_MAX
#define LL_MIN LLONG_MIN

typedef unsigned int uint;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef set<int> si;
typedef multiset<int> msi;
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}

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

  string S;
  cin >> S;
  ll ans = 0;
  char n = '0';
  rep(i, sz(S)) {
    if (S[i] != n) {
      if (n != '0') ans++;
      if (i < sz(S)-1 && S[i] == S[i+1]) {
        if (n != '0') ans += (sz(S) - 1 - i);
        n = S[i];
      }
    }
  }
  cout << ans << '\n';
  return 0;
}

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

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FOR1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define FORI(i, n) for(int (i)=n-1; (i)>=0; (i)--)
template<class T, class U> void umin(T& x, const U& y){ x = min(x, (T)y);}
template<class T, class U> void umax(T& x, const U& y){ x = max(x, (T)y);}
template<class T, class U> void init(vector<T> &v, U x, size_t n) { v=vector<T>(n, (T)x); }
template<class T, class U, typename... W> void init(vector<T> &v, U x, size_t n, W... m) { v=vector<T>(n);  for(auto& a : v) init(a, x, m...); }

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);

    const ll MOD = 1e9+7;
    int n;
    cin >> n;
    vector<int> v(n);
    FOR(i, n) cin >> v[i];
    v.push_back(0);
    sort(v.begin(), v.end());
    ll sol = 1;
    for(int i = 1; i<v.size(); i++)
        if (v[i] != v[i-1])
            sol = sol * (v[i] - v[i-1] + 1) % MOD;
    cout << sol << endl;
    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

signed main() {
    int n, p;
    cin >> n >> p;
    cout << Mint<>(p - 1) * Mint<>(p - 2).pow(n - 1) << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#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 ll long long
#define int long long
#define length size()
const int MOD = 1000000007;
const int MAX = 510000;
const int inf = 400000000000000;
template<typename T> string join(vector<T> &vec ,const string &sp){
    int si = vec.length;
    if(si==0){
        return "";
    }else{
        stringstream ss;
        rep(i,si-1){
            ss << vec[i] << sp;
        }
        ss << vec[si - 1];
        return ss.str();
    }
}
bool isPrime(int n){
    //cout << n << endl;
    if(n == 1) return false;
    else if(n%2 == 0&&n!=2) return false;
    bool f = true;
    for(int i=3;i<=sqrt(n);i+=2){
        if(n%i==0){
            f = false;
            break;
        }
    }
    return f;
}
map<int,int> pf(int n){
    map<int,int> mp;
    if(n==1){
        mp[1] = 1;
        return mp;
    }else{
        int p = 2;
        while(n!=1){
            if(n%p==0){
                if(mp.find(p)==mp.end()){
                    mp[p] = 1;
                }else{
                    mp[p]++;
                }
                n /= p;
            }else{
                (p==2)?p++:p+=2;
            }
        }
        return mp;
    }
}
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}
struct UnionFind{
    vector<int> par;
    vector<int> siz;
    int w;
    UnionFind(int n) : par(n),siz(n){
        for(int i=0;i<n;i++){par[i]=i;siz[i]=1;}
        w = n;
    }
    int root(int x){
        while(par[x]!=x){
            x = par[x] = par[par[x]];
        }
        return x;
    }
    void merge(int x,int y){
        x = root(x);
        y = root(y);
        if(siz[x]>siz[y]) swap(x,y);
        if(x!=y){
            siz[y] += siz[x];
            par[x] = y;
            w-=1;
        }
    }
    int size(int n){
        return siz[n];
    }
    int wid(){
        return w;
    }
};
vector<int> rev(vector<int> vec){
    rep(i,vec.size()){
        vec[i] = (vec[i]==1)?0:1;
    }
    return vec;
}
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
ll merge_cnt(vector<int> &a) {
    int n = a.size();
    if (n <= 1) { return 0; }

    ll cnt = 0;
    vector<int> b(a.begin(), a.begin()+n/2);
    vector<int> c(a.begin()+n/2, a.end());

    cnt += merge_cnt(b);
    cnt += merge_cnt(c);

    int ai = 0, bi = 0, ci = 0;
    // merge の処理
    while (ai < n) {
        if ( bi < b.size() && (ci == c.size() || b[bi] <= c[ci]) ) {
            a[ai++] = b[bi++];
        } else {
            cnt += n / 2 - bi;
            a[ai++] = c[ci++];
        }
    }
    return cnt;
}
signed main(void){
    int h,w;
    cin >> h >> w;
    vector<vector<int>> vec(h+2,vector<int>(w+2,0));
    rep(i,h){
        rep(j,w){
            char t;
            cin >> t;
            if(t=='#'){
                vec[i+1][j+1] = 1;
            }
        }
    }
    int ans = 0;
    rep(i,h+1){
        rep(j,w+1){
            if(vec[i][j]+vec[i][j+1]+vec[i+1][j]+vec[i+1][j+1]==1||vec[i][j]+vec[i][j+1]+vec[i+1][j]+vec[i+1][j+1]==3) ans++;
        }
    }
    cout << ans << endl;
}


#include "bits/stdc++.h"
//#include "atcoder/all"
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
//using mint = modint998244353;
//const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n-1); i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define endl "\n"
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	vector<char>cv;
	rep(i, s1.size()) { cv.push_back(s1[i]); }
	rep(i, s2.size()) { cv.push_back(s2[i]); }
	rep(i, s3.size()) { cv.push_back(s3[i]); }
	sort(cv.begin(), cv.end());
	cv.erase(unique(cv.begin(), cv.end()), cv.end());
	if (cv.size() > 10) { cout << "UNSOLVABLE " << endl; return 0; }
	vector<int> v;
	rep(i, 10) { v.push_back(i); }
	map<char, int>mp;
	do {
		int count = 0;
		rep(i, cv.size()) {
			mp[cv[i]] = v[i];
		}
		long long n1 = 0;
		long long n2 = 0;
		long long n3 = 0;
		if (0 == mp[s1[0]]) { continue; }
		if (0 == mp[s2[0]]) { continue; }
		if (0 == mp[s3[0]]) { continue; }
		rep(i, s1.size()) {
			n1 *= 10;
			n1 += mp[s1[i]];
		}
		rep(i, s2.size()) {
			n2 *= 10;
			n2 += mp[s2[i]];
		}
		rep(i, s3.size()) {
			n3 *= 10;
			n3 += mp[s3[i]];
		}
		if (n1 + n2 == n3) {
			cout << n1 << endl;
			cout << n2 << endl;
			cout << n3 << endl;
			return 0;
		}

	} while (next_permutation(v.begin(), v.end()));
	cout << "UNSOLVABLE " << endl;
	return 0;
}

// ----- In the name of ALLAH, the Most Gracious, the Most Merciful -----

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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define deb(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define memo(dp,val) memset(dp,val,sizeof(dp))
#define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(a) a.begin(),a.end()
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define dloop(i,n) for(int i=n-1;i>=0;i--)
#define iii tuple<int,int,int>
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define int long long
#define ld long double
#define pb push_back
#define endl "\n"
#define setbits __builtin_popcountll
#define mp map<int,int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007
#define inf (int)1e18

int n;
int dp[205][12];

int solve(int sz, int c){
    if(c==11) return 1;
    if(sz==n || c>11) return 0;

    int&ans = dp[sz][c];

    if(ans!=-1) return ans;

    ans = 0;

    for(int i=sz+1;i<n;i++){
        ans += solve(i,c+1);
    }
    return ans;
}

int32_t main(){
    NINJA;

    memset(dp,-1,sizeof(dp));

    cin >> n;
    cout << solve(0,0);

    return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int h, m;
	cin >> m >> h;
	cout << (h % m == 0 ? "Yes\n" : "No\n");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const ll MOD = 1e9 + 7;
const ll INF = 1e18;

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

    ll a, b;
    cin >> a >> b;
    if (b % a == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}