#include<bits/stdc++.h>
#define ll long long
#define mi 0x7fffffff
using namespace std;
int num;
int betercallabdo(vector<int>arr)
{
    int sum=0,n=arr.size();
   for(int i=0;i<n-1;i++){
   int min1=mi,pos=0;
     for(int j=i;j<n;j++)
     {
       min1=min(min1,arr[j]);
       if(min1==arr[j])pos=j;
     }
     reverse(arr.begin()+i,arr.begin()+pos+1);
     sum+=abs(pos-i)+1;
   }
   return sum;
}
void H2A()
{
   /* int n,k;
    scanf("%d%d",&n,&k);
   vector<int>v(n);
   for(int i=0;i<n;i++)v[i]=i+1;
   int counter=0;
   do{
     int ans=betercallabdo(v);
     if(ans==k)
     {
         printf("Case #%d: ",++num);
         for(int i=0;i<n;i++)
         {if(i!=n-1)cout<<v[i]<<" ";else cout<<v[i];}cout<<"\n";return;
     }
   }while(next_permutation(v.begin(),v.end()));
   printf("Case #%d: ",++num);
   cout<<"IMPOSSIBLE\n";*/
   string s;
   cin>>s;cout<<s[1]<<s[2]<<s[0];
}
int main()
{
	int t=1;//scanf("%d",&t);
	while(t--) H2A();
}

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

int main() {
    string S;
    cin >> S;
    int ans = 0;
    for (int i = 0; i < 9; i++) {
        if (S.substr(i, 4) == "ZONe") ans++;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) ((x).begin()), ((x).end())

#define READ(x) (cin >> (x))
#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))
#define WRITE_YESNO(x) (WRITE_N((x) ? "Yes" : "No"))

#define PRECISE_COUT std::cout << std::setprecision(15) << std::fixed

bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }

#define DIVIDER 1000000007LL

ll solve(ll N, ll A, ll B) {
  if (A + B > N) {
    return 0;
  }

  ll retv = (((N - A + 1) * (N - A + 1)) % DIVIDER) *
            (((N - B + 1) * (N - B + 1)) % DIVIDER);
  retv %= DIVIDER;

  ll x = (N - A + 1) * (N - B + 1) - (N - A - B + 1) * (N - A - B + 2);
  x = x % DIVIDER;
  retv = (retv - ((x * x) % DIVIDER) + DIVIDER) % DIVIDER;
  return retv;
}

int main() {
  // get values from input
  cin.tie(0);
  ios::sync_with_stdio(false);

  int T;
  cin >> T;

  // main procedure
  vector<ll> ans;
  for (size_t i = 0; i < T; i++) {
    ll N, A, B;
    cin >> N >> A >> B;
    ans.push_back(solve(N, A, B));
  }

  // output
  for (size_t i = 0; i < T; i++) {
    cout << ans[i] << endl;
  }

  return 0;
}

#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[1] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

ll sum = 0;
ll dd[200000];
ll ans[200000];
vector<int> v[200000];
int p[200000];
pii ed[200000];
// 여기를 루트로 하는 애들..

void pre(int o, int pa) {
    p[o] = pa;
    for (int i : v[o]) {
        if (i == pa) continue;
        pre(i, o);
    }
}

void go(int o, int pa, ll ss) {
    ss += dd[o];
    ans[o] = sum + ss;

    for (int i : v[o]) {
        if (i == pa) continue;
        go(i, o, ss);
    }
}

int main() {
    int n;
    scanf("%d", &n);

    for (int i = 0; i < n - 1; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        a--; b--;
        ed[i] = {a, b};
        v[a].push_back(b);
        v[b].push_back(a);
    }
    pre(0, 0);

    int q;
    scanf("%d", &q);

    for (int i = 0; i < q; i++) {
        int a,b,c;
        scanf("%d %d %d", &a, &b, &c);
        b--;

        if (a == 1) {
            if (p[ed[b].second] == ed[b].first) {
                sum += c;
                dd[ed[b].second] -= c;
            }
            else dd[ed[b].first] += c;
        }
        else {
            if (p[ed[b].first] == ed[b].second) {
                sum += c;
                dd[ed[b].first] -= c;
            }
            else dd[ed[b].second] += c;
        }
    }

    go(0, 0, 0);
    for (int i = 0; i < n; i++) printf("%lld\n", ans[i]);
}

// author: rdd6584


#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;

int solve(std::vector<int> &r, std::vector<int> &c) {
	LL ans = 0;
	LL x = abs(c[1] - c[0]), y = abs(r[1] - r[0]);
	LL h = (x + y) / 2;
	if (h >= 3) {
		++ans;
		x = abs(x - h);
		y = abs(y - h);
	}
	if (x > y) swap(x, y);
	if (x == y) {
		ans += x >= 1;
	} else {
		ans += 1 + !(x <= 2 && y <= 2 || x == 0 && y == 3);
	}
	return ans;
}

int solve2(std::vector<int>& r, std::vector<int>& c) {
	const int dy[4] = { -1, -1, 1, 1 };
	const int dx[4] = { -1, 1, -1, 1 };
	set<pair<int, int>> s;
	vector<pair<int, int>> q;
	q.emplace_back(make_pair(r[0], c[0]));
	for (int i = 0; i < 3; ++i) {
		vector<pair<int, int>> nq;
		for (auto kv : q) {
			if (kv.first == r[1] && kv.second == c[1]) return i;
			for (int y = kv.first - 3; y <= kv.first + 3; ++y) {
				for (int x = kv.second - 3; x <= kv.second + 3; ++x) {
					if (abs(kv.first - y) >= 3 && x != kv.second) continue;
					if (abs(kv.second - x) >= 3 && y != kv.first) continue;
					if (s.find(make_pair(y, x)) == s.end()) {
						s.insert(make_pair(y, x));
						nq.emplace_back(make_pair(y, x));
					}
				}
			}
			for (int d = 3; d <= 8; ++d) {
				for (int dir = 0; dir < 4; ++dir) {
					int y = kv.first + dy[dir] * d, x = kv.second + dx[dir] * d;
					if (s.find(make_pair(y, x)) == s.end()) {
						s.insert(make_pair(y, x));
						nq.emplace_back(make_pair(y, x));
					}
				}
			}
		}
		q = nq;
	}
	return 3;
}

int main() {
	std::vector<int> r(2), c(2);
	for (int i = 0; i < 2; i++) {
		std::cin >> r[i];
		std::cin >> c[i];
	}
	int ans = solve(r, c);
	cout << ans << endl;

#if defined(_WIN32) && defined(NDEBUG)
	for (int t = 0; t < 1000; ++t) {
		r = { (rand() % 10) - 5, (rand() % 10) - 5 };
		c = { (rand() % 10) - 5, (rand() % 10) - 5 };
		int x = solve(r, c);
		int y = solve2(r, c);
		if (x != y) {
			printf("FAILED! %d,%d,%d,%d\n", r[0], c[0], r[1], c[1]);
			++x;
		}
	}
#endif
	return 0;
}

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

#define inf 1001000009
#define infmx 1e18ll
#define ff first
#define ss second
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) x.begin(),x.end()
///debug
#define wh(x)   cerr<<#x<<" is "<<x<<endl;
#define error(args...){string _s=#args;replace(_s.begin(),_s.end(),',',' ');stringstream _ss(_s);istream_iterator<string> _it(_ss);err(_it,args);}
void err(istream_iterator<string>it){cout<<endl;}
template<class H,class... T>void err(istream_iterator<string>it,H a,T... t){cerr<<*it<<" = "<<a<<" | ";err(++it,t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class T>auto&operator<<(ostream& os,vector<T>_v){bool a=1;for(auto x:_v){os<<(a?"":" ")<<x;a=0;}return os;}
///
typedef pair<ll,ll>pi;
typedef pair<long long,long long>pll;
typedef pair<pi,ll>ppi;
typedef pair<ll,pi>pip;
typedef vector<ll>vi;
typedef vector<pi>vpi;
const ll mod=1e9+7;
ll power(ll a,ll p){ll r=1,y=a;while(p){if(p&1)r=(1LL*r*y)%mod;p>>=1;y=(1LL*y*y)%mod;}return r;}

const ll N=2100000;
ll ara[N];

int main()
{
    IOS;
    ll a,b;
    ll c,d;
    cin>>a>>b>>c>>d;
    ll ans;
    if(a==c&&b==d)ans=0;
    else if(a-b==c-d)ans=1;
    else if(a+b==c+d)ans=1;
    else if(abs(c-a)+abs(d-b)<=3)ans=1;
    else if((abs(a-b)%2)==(abs(c-d)%2))ans=2;
    else if(abs((a-b)-(c-d))<=3)ans=2;
    else if(abs((a+b)-(c+d))<=3)ans=2;
    else if(abs(a-c)+abs(b-d)<=6)ans=2;
    else ans=3;
    cout<<ans<<endl;
}


#include <algorithm>
#include <iomanip>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <numeric>
#include <vector>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i, n) _rep2(i, 0, n)
#define _rep2(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using i64 = long long;
template<class T, class U>
bool chmin(T& a, const U& b) { return (b < a) ? (a = b, true) : false; }
template<class T, class U>
bool chmax(T& a, const U& b) { return (b > a) ? (a = b, true) : false; }

template<typename T>istream& operator>>(istream&i,vector<T>&v){rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(vector<T>&v){stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v){if(v.size())o<<join(v);return o;}
template<typename T>string join(vector<vector<T>>&vv){string s="\n";rep(i,vv.size())s+=join(vv[i])+"\n";return s;}
template<typename T>ostream& operator<<(ostream&o,vector<vector<T>>&vv){if(vv.size())o<<join(vv);return o;}
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;

const int MAX_V = 200005;

vector<int> to[MAX_V];
int dep[MAX_V];
int in[MAX_V];
int out[MAX_V];
int k;
vector<int> ls[MAX_V]; // 深さごとの頂点リスト

void dfs(int v, int d)
{
    in[v] = k; // 来た時に何番だったか
    k++;
    dep[v] = d;
    for(auto i : to[v]) dfs(i, d + 1);
    out[v] = k; // 帰ってきたときに何番だったか
}

int calc(int d, int r)
{
    // ls[d]内で，rより大きい要素数を数える．
    return lower_bound(all(ls[d]), r) - ls[d].begin();
}

int main()
{
    int n;
    cin >> n;
    rep(i, n - 1)
    {
        int p;
        cin >> p;
        to[p - 1].push_back(i + 1);
    }
    dfs(0, 0);
    rep(i, n) ls[dep[i]].push_back(in[i]);
    rep(i, n) sort(all(ls[i]));

    int q;
    cin >> q;
    while(q--)
    {
        int u, d;
        cin >> u >> d;
        --u;
        int ans = calc(d, out[u]) - calc(d, in[u]); // ls[d] の中で [in[u], out[u]) である部分を数える
        cout << ans << endl;
    }

    return 0;
}

/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N_MAX = 200000;

int n;

int a[N_MAX * 2 + 2];

int p[N_MAX * 2 + 2];

bool cmp (const int &x, const int &y)
{
    return a[x] < a[y];
}

bool color[N_MAX * 2 + 2];

set <int> sPos;

set <pair <int, int>> sPair;

bool answer[N_MAX * 2 + 2];

void del (int i)
{
    set <int> :: iterator it = sPos.find(i);
    set <int> :: iterator itl, itr;
    bool L = false, R = false;
    itl = it;
    if(itl != sPos.begin())
    {
        L = true;
        itl--;
        if(color[*itl] != color[i])
            sPair.erase(make_pair(*itl, i));
    }
    itr = it;
    itr++;
    if(itr != sPos.end())
    {
        R = true;
        if(color[i] != color[*itr])
            sPair.erase(make_pair(i, *itr));
    }
    if(L == true && R == true)
    {
        if(color[*itl] != color[*itr])
            sPair.insert(make_pair(*itl, *itr));
    }
    sPos.erase(i);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n * 2; i++)
        cin >> a[i];
    for(int i = 1; i <= n * 2; i++)
        p[i] = i;
    sort(p + 1, p + n * 2 + 1, cmp);
    for(int i = 1; i <= n; i++)
        color[p[i]] = 1;
    for(int i = 1; i <= n * 2; i++)
        sPos.insert(i);
    for(int i = 1; i < n * 2; i++)
        if(color[i] != color[i + 1])
            sPair.insert(make_pair(i, i + 1));
    while(sPair.empty() == false)
    {
        pair <int, int> p = *sPair.begin();
        answer[p.first] = 0;
        answer[p.second] = 1;
        del(p.first);
        del(p.second);
    }
    assert(sPos.empty() == true);
    for(int i = 1; i <= n * 2; i++)
        if(answer[i] == 0)
            cout << "(";
        else
            cout << ")";
    cout << "\n";
    return 0;
}


#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define pll pair<ll,ll>
#define ppl pair<pll,ll>
#define plp pair<ll,pll>
#define pi 3.14159265358979323846264338327950
const ll MOD=1e9 + 7;
const ll N=2e5 + 7;
using namespace std;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// use rng for random number generation

ll POWER(ll base,ll expo)
{
    ll ret=1;
    while(expo)
    {
        if(expo&1)ret=ret*base;
        expo>>=1;
        base=base*base;
    }
    return ret;
}

ll ext_gcd(ll a,ll b,ll& x,ll& y)
{
    ll d = a;
    if(b == 0){
        x = 1;
        y = 0;
    }
    else{
        d = ext_gcd(b,a%b,y,x);
        y -= (a/b)*x;
    }
    return d;
}

ll mod_inv(ll a,ll m)
{
    ll x,y;
    ext_gcd(a,m,x,y);
    return (x%m + m)%m;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll test_cases = 1; //cin>>test_cases;
    while(test_cases --)
    {
        //freopen("input.txt","r",stdin);
        //freopen("output.txt","w",stdout);
        ll a,b,k; cin>>a>>b>>k;
        string s;
        for(ll i=0;i<a;i++)s += 'a';
        for(ll i=a;i<a+b;i++)s += 'b';

        k--;
        ll l = 0, r = a;
        ll n = a + b;
        while(k > 0){
            ll x = (n - r);
            ll num = n - r + 1;
            ll denom = 2;
            ll st = -1;
            for(ll i=r-1;i>=l;i--){
                if(k - x >= 0){
                    k -= x;
                    st = i;
                    x = (x*num)/denom;

                    if(k == 0){
                        ll cnta = 0;
                        ll cntb = 0;
                        for(ll j=i;j<n;j++){
                            if(s[j] == 'a')cnta++;
                            else cntb++;
                        }

                        for(ll j=i;j<n;j++){
                            if(cntb > 0){
                                s[j] = 'b';
                                cntb--;
                            }
                            else if(cnta){
                                s[j] = 'a';
                                cnta--;
                            }
                        }
                    }

                    num++;
                    denom++;
                }
                else break;
            }

            if(k == 0)break;

            if(st != -1){
                swap(s[st-1],s[r]);
                k--;
                l = st + 1;
                r = r + 1;
            }
            else break;
        }

        while(k > 0){
            k--;

            bool ok = next_permutation(s.begin(),s.end());
        }

        cout<<s;
    }
    return 0;
}

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

#define IO          ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int         long long
#define double      long double
#define vi          vector<int>
#define vvi         vector<vi>
#define pii         pair<int, int>
#define vii         vector<pii>
#define endl        '\n'
#define pb          push_back
#define all(v)      (v).begin(), (v).end()
#define rall(v)     (v).rbegin(), (v).rend()
#define mod         1000000007

int C[61][31];

void solve() {
	int a, b, k;
	cin >> a >> b >> k;
	C[0][0] = 1;
	for (int i = 1; i <= a + b; i++) {
		for (int j = 0; j <= a; j++) {
			if (i - 1 >= 0 && j - 1 >= 0)
				C[i][j] = C[i - 1][j - 1];
			if (i - 1 >= 0)
				C[i][j] += C[i - 1][j];
		}
	}
	// for (int i = 1; i <= a + b; i++) {
	// 	for (int j = 0; j <= a; j++) {
	// 		cerr << C[i][j] << ' ';
	// 	}
	// 	cerr << endl;
	// }
	while (a > 0 && b > 0) {
		int v = C[a + b - 1][a - 1];
		if (v >= k) {
			cout << 'a';
			a--;
		} else {
			cout << 'b';
			b--;
			k -= v;
		}
	}
	cout << string(a, 'a');
	cout << string(b, 'b');
	cout << endl;
}

signed main() {
	IO;
	int t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}


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

typedef long long ll;

int main() {

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

    int n = 0, k = 0;
    cin >> n >> k;

    vector<int> v(n, 0);
    vector<int> cnt(3e5 + 5, 0);

    long long ans = 0;
    for(int i = 0; i < n; i++) {
        cin >> v[i];
        cnt[v[i]]++;
    }

    for(int i = 0; i < 3e5 + 5; i++) {
        int temp = k - cnt[i];
        if(temp > 0) {
            ans += temp * i;
            k = cnt[i];
        }
    }

    cout << ans << endl;

    return 0;
}

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

using ll = long long;

void solve(long long N, long long K, std::vector<long long> a){
    map<ll, int> mp;
    for(int i = 0;i < N;i++){
        mp[a[i]]++;
    }
    ll ans = 0;
    for(int i = 0;i < K;i++){
        for(int j = 0;j < 1e9;j++){
            if(mp[j] != 0){
                mp[j]--;
            }else{
                ans += j;
                break;
            }
        }
    }
    cout<<ans<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    solve(N, K, std::move(a));
    return 0;
}


    //Bismillahir Rahman-ir Rahim
#include<bits/stdc++.h>
#include<cstdio>

#define PI acos(-1)
#define F first
#define S second
#define debug(x)  cout<<'>'<<#x<<":"<<x<<endl
#define tara ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define Y printf("YES\n")
#define N printf("NO\n")
#define ll long long
#define lll __int128
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<long,long>
#define eb emplace_back
#define pb push_back
#define sc scanf
#define pf printf
#define endl '\n'
#define INF 1<<30
#define ll_INF 1LL<<62
#define MODU 998244353
const int M=1e5;

#define on(x) (marked[x/64] & (1<<((x%64)/2)))
#define mark(x)  marked[x/64] |= (1<<((x%64)/2))

using namespace std ;

int marked[M/64 + 2];
void bitsieve(int n) {
  for (int i = 3; i * i < n; i += 2) {
    if (!on(i)) {
      for (int j = i * i; j <= n; j += i + i) {
        mark(j);
      }
    }
  }
}

bool bitisPrime(int num) {
  return num > 1 && (num == 2 || ((num & 1) && !on(num)));
}

bool isPrime(int n)
{
    if (n <= 1)
        return false;

    for (int i = 2; i < n; i++)
        if (n % i == 0)
            return false;

    return true;
}

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

}

struct node{
    int x, y ;
};

bool cmp(int a, int b ){
    return a>b ;
}

int main(){
    //tara ;
    int n ;
    cin>>n ;
    ll sum=0 ;
    while(n--){
        int a, b ; cin>>a>>b ;
        a-- ;
        ll aa=0,bb=0 ;
        if(a&1){
            aa=(a+1)/2 ;
            aa*=a ;
        }
        else {
            aa=a/2 ;
            aa*=(a+1) ;
        }
         if(b&1){
            bb=(b+1)/2 ;
            bb*=b ;
        }
        else {
            bb=b/2 ;
            bb*=(b+1) ;
        }

        sum+=(bb-aa) ;
    }
    cout<<sum<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	long long sum=0;
	for(int i=1;i<=n;i++){
		long long a,b;
		scanf("%lld%lld",&a,&b);
		sum=sum+(a+b)*(b-a+1)/2;
	}
	printf("%lld\n",sum);
}


#include <bits/stdc++.h>
using Int = long long;  // clang-format off
using pii = std::pair<Int, Int>;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define RREP_(i, a_, b_, a, b, ...) for (Int i = Int(b) - 1, low##i = (a); i >= low##i; i--)
#define RREP(i, ...) RREP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on
struct in {
    template <class T> operator T() {
        T t;
        std::cin >> t;
        return t;
    }
};
void out() { std::cout << "\n"; }
template <class Head, class... Tail> void out(Head&& h, Tail&&... t) {
    std::cout << h << (sizeof...(Tail) == 0 ? "" : " "), out(std::forward<Tail>(t)...);
}
template <class T> bool chmin(T& a, const T& b) { return a > b ? a = b, true : false; }
template <class T> bool chmax(T& a, const T& b) { return a < b ? a = b, true : false; }
template <class T> using V = std::vector<T>;

/**
 *    author:  knshnb
 *    created: Tue Mar 30 22:53:03 JST 2021
 **/

/// @docs src/Helper/BinarySearch.md
template <class F> long long binary_search(long long ok, long long ng, F check) {
    while (std::abs(ok - ng) > 1) {
        long long mid = (ok + ng) / 2;
        (check(mid) ? ok : ng) = mid;
    }
    return ok;
}

signed main() {
    Int n = in(), K = in();
    V<V<Int>> g(n);
    REP(i, n - 1) {
        Int u = (Int)in() - 1, v = (Int)in() - 1;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    auto check = [&](Int mid) {
        Int cnt = 0;
        V<Int> no_ma(n, 0), mi(n, 1e18);
        auto dfs = [&](auto&& self, int v, int prv = -1) -> void {
            for (int s : g[v]) {
                if (s == prv) continue;
                self(self, s, v);
                chmin(mi[v], mi[s] + 1);
                chmax(no_ma[v], no_ma[s] + 1);
            }
            if (no_ma[v] + mi[v] <= mid) no_ma[v] = -1;
            if (no_ma[v] >= mid) {
                cnt++;
                no_ma[v] = -1;
                mi[v] = 0;
            }
        };
        dfs(dfs, 0);
        if (no_ma[0] >= 0) cnt++;
        return cnt <= K;
    };
    Int ans = binary_search(n, -1, check);
    out(ans);
}

#include <bits/stdc++.h>

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

using namespace std;

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

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

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

    int a, b;
    cin >> a >> b;
    a += b;

    if(a>=15 && b>=8){
        cout << 1 << endl;
    }else if(a>=10 && b>=3){
        cout << 2 << endl;
    }else if(a>=3){
        cout << 3 << endl;
    }else{
        cout << 4 << endl;
    }

    return 0;

}


#include <bits/stdc++.h>
#include <fstream>
#define FIXED_FLOAT(x)  std::fixed <<std::setprecision(20) << (x)
#define all(v) (v).begin(), (v).end()
using namespace  std;
#define forn(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
int mod = (ll)1e9 + 7;
#define PI acos(-1)
typedef pair<int, int> pairs;
typedef complex<ll> G;
const int INF = 1e9 + 1;
const int N = 1.5e6 + 10;
const double eps = 1e-3;

template <typename XPAX>
void ckma(XPAX &x, XPAX y) {
    x = (x < y ? y : x);
}
template <typename XPAX>
void ckmi(XPAX &x, XPAX y) {
    x = (x > y ? y : x);
}

ll power(ll a, ll b){
    if(!b)
        return 1;
    ll c=power(a,b/2);
    c=(1LL*c*c);
    if(b%2)
        c=(1LL*c*a);
    return c;
}

int mul(int a, int b) {
    return a * 1ll * b % mod;
}
int add(int a, int b) {
    int s = (a+b);
    if (s>=mod) s-=mod;
    return s;
}

template<long long mod = 1000000007>
struct modint{
	long long a;

	modint() : a(0){}
	modint(long long t){
		a = t % mod;
		if(a < 0) a += mod;
	}

	operator long long() const{ return a; }

	bool operator==(const modint &x) const{ return a == x.a; }
	bool operator!=(const modint &x) const{ return a != x.a; }

	modint operator-() const{ return modint(a ? (mod - a) : 0); }
	modint operator~() const{ return pow(mod - 2); }

	modint operator+(const modint &x) const{ return modint(*this) += x; }
	modint operator-(const modint &x) const{ return modint(*this) -= x; }
	modint operator*(const modint &x) const{ return modint(*this) *= x; }
	modint operator/(const modint &x) const{ return modint(*this) /= x; }

	modint &operator+=(const modint &x){
		a += x.a;
		if(a >= mod) a -= mod;
		return *this;
	}
	modint &operator-=(const modint &x){
		a -= x.a;
		if(a < 0) a += mod;
		return *this;
	}
	modint &operator*=(const modint &x){
		a = a * x.a % mod;
		return *this;
	}
	modint &operator/=(const modint &x){
		a = a * (~x).a % mod;
		return *this;
	}

	friend ostream &operator<<(ostream &os,const modint &x){
		return os << x.a;
	}
	friend istream &operator>>(istream &is,modint &x){
		long long t;
		is >> t;
		x = modint(t);
		return is;
	}

	modint pow(long long x) const{
		modint ret = 1,tmp = a;
		for(;x;tmp *= tmp,x >>= 1){
			if(x & 1) ret *= tmp;
		}
		return ret;
	}
};
const ll MOD = 1e9 + 7;
using Mint = modint<MOD>;
struct FenwickTree {
    vector<int> bit;  // binary indexed tree
    int n;

    FenwickTree(int n) {
        this->n = n;
        bit.assign(n, 0);
    }

    FenwickTree(vector<int> a) : FenwickTree(a.size()) {
        for (size_t i = 0; i < a.size(); i++)
            add(i, a[i]);
    }

    int sum(int r) {
        int ret = 0;
        for (; r >= 0; r = (r & (r + 1)) - 1)
            ret += bit[r];
        return ret;
    }

    int sum(int l, int r) {
        return sum(r) - sum(l - 1);
    }

    void add(int idx, int delta) {
        for (; idx < n; idx = idx | (idx + 1))
            bit[idx] += delta;
    }
};

template<class T>
struct Combination{
	vector<T> fact,factinv;
	Combination(int n) : fact(n + 1),factinv(n + 1){
		fact[0] = 1;
		for(int i = 1;i <= n;i++) fact[i] = fact[i - 1] * T(i);
		factinv[n] = ~fact[n];
		for(int i = n;i >= 1;i--) factinv[i - 1] = factinv[i] * T(i);
	}
	T nCr(int n,int r){
		if(n < 0 || r < 0 || n < r) return 0;
		return fact[n]  * factinv[r] *  factinv[n - r];
	}
	T factorial(int x) {
        if(x < 0)return 0;
        return fact[x];
	}
};

void done() {

    int a, b;
    cin >> a >> b;
    cout << (b%a == 0 ? "Yes" : "No");

}

void solve()
{

}

void emer() {

    // start from here
    //
    //
}

void another() {

}
void test_case() {
    int t;
    cin >> t;
    forn(p, t) {

        //cout << "Case #" << p + 1 << ": ";
        done();
    }
}
int main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    done();
    // 5 4 3 2 1

}

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

#define ll long long
#define endl '\n'
const int Modulo=1e9+7;
int N=1e5+5;
bool myCompare(int a,int b)
{
  return a>b;
}
bool checkPrime(int n)
{
    int flag=1;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        flag=0;
    }
    if(flag)
    return true;
    else
    return false;

}
 vector<bool>prime(N + 1,true);
void SieveOfEratosthenes(int n)
{

    // memset(prime, true, sizeof(prime));
    prime[0]=prime[1]=false;
    for (int p = 2; p * p <= n; p++)
    {

        if (prime[p] == true)
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
}
ll power(ll a,ll b)
{
    ll result=1;
    while(b>0){
    if(b&1){
    result=(result*a);}

    a=(a*a);

    b=b>>1;
    }
   return result;

}
ll fastModuloExponentiation(ll a,ll b,ll M)
{
    ll result=1;
    while(b>0){
    if(b&1){
    result=(result*a)%M;}

    a=(a*a)%M;

    b=b>>1;
    }
   return result;

}

void solve()
{
 float a,b;
 cin>>a>>b;
 int discount=a-b;
 float ans=(float(discount)/float(a))*100;
 cout<<ans;

}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
//   SieveOfEratosthenes(n);
//   int t;
//   cin >> t;
//   while (t--)
    solve();

}


// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define forn(i, s, n)  for(ll i=(ll)s; i<(ll)(n); i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define pll pair<long long int, long long int>
#define pii pair<int, int>
#define pss pair<string, string>
#define ull unsigned long long int
#define lld long double
#define F first
#define S second
#define PI 3.141592653589793238
#define prec(n) fixed<<setprecision(n)
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define itsval(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); itval(_it, args); }
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

void itval(istream_iterator<string> it) {}
template<typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    itval(++it, args...);
}
const ll MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {cout << x << "\n";}
template <typename T>
inline void printvec(T x) {for (auto a : x) cout << a << ' '; cout << '\n';}
// -----------------------------------------------------------------------

struct custom {
    bool operator()(const pair<int, pii> &p1, const pair<int, pii> &p2)const {

        return p1.F < p2.F;
    }
};

// Calculate a^b % MOD -------------------------------------------------
ll get_pow(ll a, ll b, ll M = MOD) {
    ll res = 1;
    while (b) {
        if (b & 1) res = (res * a) % M;
        a = (a * a) % M;
        b >>= 1;
    }
    return res;
}
// ---------------------------------------------------------------------
const ll N = 1e5 + 5, inf = 2e18;
lld dp[N];
void solve()
{
    ll n;
    cin >> n;
    lld ans = 0;
    forn(i, 1, n + 1)
    ans += ((lld)n) / (lld)i;
    cout << prec(10) << ans - 1;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output1.txt", "w", stdout);
#endif
    int test = 1;
    //cin >> test;
    clock_t z = clock();

    forn(tes, 0, test)
    {
        // cout << "Case #" << tes + 1 << ": ";
        solve();

    }
    debug("Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC);
    return 0;
}

#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<vector<vector<int>>> v3int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef vector<vector<vector<ll>>> v3ll;
typedef list<int> liint;
typedef pair<int, int> pint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, int>> vpll_int;
typedef vector<pair<int, ll>> vpint_ll;
typedef set<pair<int, int>> spint;
typedef set<pair<ll, int>> spll;
typedef unordered_map<int, unordered_set<int>> Graph;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }

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

    ll ans = 0;
    int N = S.size();
    unordered_map<char, int> num;
    for (int i = N - 1; i >= 1; i--) {
        if (S[i] == S[i - 1]) {
            ans += (N - 1 - i) - num[S[i]];
            REP(c, 'a', 'z' + 1) {
                num[c] = 0;
            }
            num[S[i]] = N - i;
        }
        else {
            num[S[i]]++;
        }
    }
    cout << max(0LL, ans) << endl;
    return 0;
}


#include <cstring>
#include <iostream>
#include <algorithm>
#include <set>

using namespace std;

typedef pair<int, int> E;
const int N = 250005;
const int M = 1e8;
const int R = 505;

int n, m;
int h[N], e[M], ne[M], w[M], idx;
int dist[N];
set<E> q;

inline int id(int x, int y) {
    return (x - 1) * m + y;
}

inline void add(int a, int b, int c) {
    e[++idx] = b, w[idx] = c, ne[idx] = h[a], h[a] = idx;
}

int dijkstra(int S, int T) {
    memset(dist, 0x3f, sizeof dist);
    dist[S] = 0, q.insert({0, S});
    while (q.size()) {
        int t = (*q.begin()).second;
        if (t == T) break;
        q.erase(q.begin());
        for (int i = h[t]; i; i = ne[i]) {
            if (dist[e[i]] > dist[t] + w[i]) {
                if (q.find({dist[e[i]], e[i]}) != q.end()) {
                    q.erase({dist[e[i]], e[i]});
                }
                dist[e[i]] = dist[t] + w[i];
                q.insert({dist[e[i]], e[i]});
            }
        }
    }
    return dist[T];
}

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 1, j, x; i <= n; ++i) {
        for (j = 1; j < m; ++j) {
            scanf("%d", &x);
            add(id(i, j), id(i, j + 1), x);
            add(id(i, j + 1), id(i, j), x);
        }
    }
    for (int i = 1, j, x; i < n; ++i) {
        for (j = 1; j <= m; ++j) {
            scanf("%d", &x);
            add(id(i, j), id(i + 1, j), x);
        }
    }
    for (int x = 1; x <= n; ++x) {
        for (int y = 1; y <= m; ++y) {
            for (int r = 1; r < x; ++r) {
                add(id(x, y), id(x - r, y), r + 1);
            }
        }
    }
    printf("%d\n", dijkstra(id(1, 1), id(n, m)));
    return 0;
}

// 問題の URL を書いておく
//

#include <bits/stdc++.h>

using namespace std;

#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)

#endif

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

using ll = long long;

struct D
{
    int to;
    int cost;
};

ll INF = 100100100100100100;

vector<ll> calc(int s, int vmax, vector<vector<D>>& g)
{
    vector<ll> dist(vmax, INF);
    using P = pair<int, int>;
    priority_queue<P, vector<P>, greater<P>> q;
    vector<bool> visit(vmax);
    q.push({0, s});
    while(!q.empty())
    {
        auto t = q.top();
        q.pop();
        auto index = t.second;
        auto cost = t.first;
        if(visit[index]) continue;
        visit[index] = true;
        if(cost >= dist[index]) continue;
        dist[index] = cost;
        for(auto to : g[index])
        {
            q.push({cost + to.cost, to.to});
        }
    }
    return dist;
}

int main(int, const char**)
{
    int R, C;
    cin >> R >> C;
    vector<vector<int>> A(R, vector<int>(C));
    vector<vector<int>> B(R, vector<int>(C));
    rep(i, R) rep(j, C - 1) cin >> A[i][j];
    rep(i, R - 1) rep(j, C) cin >> B[i][j];

    int vmax = R * C;

    vector<vector<D>> V(vmax * 2);
    rep(i, vmax)
    {
        auto& v = V[i];
        auto y = i / C;
        auto x = i % C;
        if(x < C - 1)
        {
            v.push_back({i + 1, A[y][x]});
        }
        if(x > 0)
        {
            v.push_back({i - 1, A[y][x - 1]});
        }
        if(y < R - 1)
        {
            v.push_back({i + C, B[y][x]});
        }
    }
    rep(i, C)
    {
        rep(j, R - 1)
        {
            auto ty = R - j - 1;
            auto toy = ty - 1;
            auto dty = ty + R;
            auto dtoy = dty - 1;

            auto& dv = V[dty * C + i];
            dv.push_back({dtoy * C + i, 1});

            auto& tdv = V[dtoy * C + i];
            tdv.push_back({toy * C + i, 1});

            auto& v = V[ty * C + i];
            v.push_back({dty * C + i, 0});
        }
    }

    auto dists = calc(0, vmax * 2, V);
#if 0
    rep(i, R)
    {
        rep(j, C)
        {
            printf("%lld ", dists[i * C + j]);
        }
        printf("\n");
    }
#endif
    cout << dists[vmax - 1] << endl;

    return 0;
}


#include <bits/stdc++.h>

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

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

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

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

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

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

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

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

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

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

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

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

ll in(int L, int R, int g) {
    int lo = (L+g-1)/g;
    int hi = R/g;
    return (hi-lo+1LL);
}

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

    int L = max(2,ni());
    int R = ni();
    if (L>R) {
        cout << 0;
        return 0;
    }
    const int maxn = 1000000;
    ll dp[maxn+1];
    ll ans = 0LL;
    for (int i = R; i >= 2; i--) {
        dp[i] = in(L,R,i)*in(L,R,i);
        for (int j = 2*i; j <= R; j += i)
            dp[i] -= dp[j];
        ans += dp[i];
    }

    //remove people who divide each other
    ll bad = 0LL;
    for (int x = L; x < R; x++) {
        bad += in(x+1,R,x);
    }
    ans = ans-2*bad-(R-L+1);
    cout << ans;
}

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

long long L, R;
long long T[1000005];

int main() {
  cin >> L >> R;

  if (L < 2) { L = 2; }
  long long ans = 0;
  for (int g = R; g >= 2; g--) {
    long long w = R/g - (L-1)/g;
    T[g] = w*w;
    for (int gg = g*2; gg <= R; gg+=g) {
      T[g] -= T[gg];
    }
    ans += T[g];
  }

  for (int i = L; i <= R; i++) {
    ans -= R/i*2-1;
  }
  cout << ans << endl;

  // long long ans2 = 0;
  // for (int x = L; x <= R; x++) {
  //   for (int y = x+1; y <= R; y++) {
  //     int g = gcd(x, y);
  //     if (g != 1 && x != g && y != g) { ans2 += 2; }
  //   }
  // }
  // cout << ans2 << endl;
}


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

// geometry

using C = complex<double>;

int main()
{
    io;
    int n; cin >> n;
    double a, b, c, d;
    cin >> a >> b >> c >> d;
    C A(a, b), B(c, d);
    C O = (A + B) / 2.0;
    double rad = 2.0 * M_PI / n;
    C r(cos(rad), sin(rad));
    C ans = O + (A - O)*r;
    cout << real(ans) << ' ' << imag(ans) << endl;
    return 0;
}

#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
#define lin(x) ll x; cin>>x;
#define stin(x) string x; cin>>x;
#define yn(x)  if(x) {  cout<<"Yes"<<endl;   }    else {    cout<<"No"<<endl;   }
#define YN(x)  if(x) {  cout<<"YES"<<endl;   }    else {    cout<<"NO"<<endl;   }
#define co(x) cout<<x<<endl;
using ll=long long;
using ld=long double;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll mod=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ld pi=3.14159265368979;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template <typename T> inline bool chmax(T &a, T b) {
    return ((a < b) ? (a = b, true) : (false));
}
template <typename T> inline bool chmin(T &a, T b) {
    return ((a > b) ? (a = b, true) : (false));
}
ll powmod(ll n, ll k, ll m) {
ll r=1;
 for(; k>0; k >>=1) {
   if(k&1) r=(r*n)%m;
   n=(n*n)%m;
 }
  return r;
}

ll fact(ll n) {
ll a=1;
rep(i,n) {
a=a*(n-i);
}
return a;
}

ll pow(ll a, ll b) {
ll x=1;
rep(i,b) {
x=x*a;
}
return x;
}

int main() {
 lin(N);
  lin(a);
  lin(b);
  lin(c);
  lin(d);

  ld xm=(ld)(a+c)/(ld)2;
  ld ym=(ld)(b+d)/(ld)2;

  //vector radius

  ld x=a-xm;
  ld y=b-ym;

  ld theta=(ld)2*3.14159265358979/(ld)N;
  ld z1=cos(theta)*x-sin(theta)*y;
  ld z2=sin(theta)*x+cos(theta)*y;
  CST(15);
  cout<<xm+z1<<" "<<ym+z2<<endl;
}


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

typedef long long int in;

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

    cout<<min({a,b,c,d});

    return 0;
}

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using C = complex<double>;

int solve() {
    ll r1, c1, r2, c2;
    cin >> r1 >> c1;
    cin >> r2 >> c2;
    if (r1 == r2 && c1 == c2) return 0;
    if (r1 + c1 == r2 + c2) return 1;
    if (r1 - c1 == r2 - c2) return 1;
    if (abs(r1-r2) + abs(c1-c2) <= 3) return 1;
    if ((r1+c1) % 2 == (r2+c2) % 2) return 2;
    if (abs(r1-r2) + abs(c1-c2) <= 6) return 2;
    if (abs((r1+c1)-(r2+c2)) <= 3 || abs((r1-c1)-(r2-c2)) <= 3) return 2;
    return 3;
}

int main() {
   cout << solve() << endl;
}


#include<iostream>
#include<utility>
#include<algorithm>
#include<set>
#include<vector>
#include<cmath>
#define forn(i, x, n) for(int i = x; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int mod = 998244353;
const bool DEBUG = 0;

vector<int> primes;
vector<int> lp(2e5+1);

void sieve(){
    forn(i, 2, lp.size()){
        if(lp[i] == 0){
            lp[i] = i;
            primes.push_back(i);
        }
        for(int j = 0; j < primes.size() && primes[j] <= i && primes[j]*i < lp.size(); j++){
            lp[primes[j]*i] = primes[j];
        }
    }

}

void solve(){
    int k;
    cin>>k;
    sieve();
    ll ans = 1;
    forn(i, 2, k+1){
        ll prod = 1;
        for(ll tmp = i, x = lp[tmp]; tmp > 1; x = lp[tmp]){
            ll p = 0;
            while(tmp%x == 0) tmp /= x, p++;
            if(DEBUG) cout<<i<<' '<<p<<'\n';
            prod  *= (p+2)*(p+1)/2;
        }
        if(DEBUG) cout<<prod<<'\n';
        ans += prod;
    }
    cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t = 1;
    //cin>>t;
	//while(t--) cout<<solve()<<'\n';
	while(t--) solve(), cout<<'\n';

}

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

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

  int ans = 0;
  for( int i = 1; i <= K; i++ ){
    for( int j = 1; j <= K; j++ ){
      if( i*j > K ) break;
      ans += K/(i*j);
    }
  }
  cout << ans << endl;
}


// C - Made Up
#include <bits/stdc++.h>
#define repi(i, s, n) for(int i=(int)(s); i<(int)(n); ++i)
#define rep(i, n) repi(i, 0, n)
#define rrep(i, n, s) for(int i=(int)(n-1); i>=(int)(s); --i)
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main(){
    int n;
    cin >> n;
    map<int, int> a;
    vector<int> b(n);
    rep(i, n){
        int aa; cin >> aa;
        ++a[aa];
    }
    rep(i, n) cin >> b[i];
    vector<int> d(n, 0);
    rep(i, n){
        int c; cin >> c;
        ++d[c-1];
    }
    ll ans = 0;
    rep(i, n){
        if(d[i]){
            if(a[b[i]]){
                ll v =(ll)a[b[i]]*d[i];
                ans += v;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
using Graph = vector<vector<ll>>;
#define all(x) (x).begin(), (x).end() //string の sort とかはこれ
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

const ll MOD = 1000000007;
const ll INF = 1e18;                    //1*10^18
const double PI = 3.141592653589793238; //18桁
const ll MAX = 1e6;
long long fac[MAX], finv[MAX], inv[MAX];

int ctoi(char c)
{
  if (c >= '0' && c <= '9')
  {
    return c - '0';
  }
  return 0;
}

ll gcd(ll x, ll y) { return (x % y) ? gcd(y, x % y) : y; }
//最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//最小公倍数

ll powll(ll a, ll n)
{ //O(log n)
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a;
    }
    a = a * a;
    n >>= 1; //(n & 1)=(n % 2 !=0)
  }
  return res;
}

ll modpow(ll a, ll n, ll mod) //O(log n)
{
  ll res = 1;
  while (n > 0)
  {
    if (n & 1) //(n & 1)=(n % 2 !=0)
    {
      res = res * a % mod;
    }
    a = a * a % mod;
    n >>= 1; //(n>>=1)=(n/2)
  }
  return res;
}

int ReturnDigit(ll num)
{
  string number = to_string(num);
  return number.length();
}

// テーブルを作る前処理
void COMinit() //MODは素数じゃないとだよ！！
{
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++)
  {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

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

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

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

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

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

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

// // 汎用的な二分探索のテンプレ判定部分
// bool isOK(int index, int key) {
//     if (a[index] >= key) return true;
//     else return false;
// }

// 汎用的な二分探索のテンプレ
// int binary_search(int key) {
//     int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
//     int right = (int)a.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

//     /* どんな二分探索でもここの書き方を変えずにできる！ */
//     while (right - left > 1) {
//         int mid = left + (right - left) / 2;

//         if (isOK(mid, key)) right = mid;
//         else left = mid;
//     }

//     /* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
//     return right;
// }
int main()
{
  // COMinit();
  // srand((unsigned int)time(NULL));//--> rand()
  ll i, j, k, l, ans=0;
  ll n;
  ll t[5000];
  string s[5000];
  pair<ll ,string> p[5000];
  cin >> n;
  for(i=0; i<n; i++)
  {
      cin>>p[i].second;
      cin>>p[i].first;
  }
sort(p,p+n,greater<pair<int, string>>());
for(i=0; i<n; i++)
{
    // cout<<p[i].second<<" "<<p[i].first<<endl;
}
  cout << p[1].second << endl;
}


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

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

    int count = 0;
    for (int i = 0; i < N; i++) {
        int x;
        cin >> x;
        if (x > 10)
            count += x - 10;
    }

    cout << count << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>           pii;
typedef pair<string,string>     pss;
typedef pair<ll,ll>             pll;
typedef vector<int>             vi;
typedef vector<vi>              vvi;
typedef vector<pii>             vpi;
typedef vector<ll>              vl;
typedef vector<vl>              vvl;
#define f(i,a,b)                for(int (i)=(a);(i)<(b);(i)++)
#define d(i,a,b)                for(int (i)=a;(i)>=(b);(i)--)
#define foreach(a,b)            for(auto&(a) : (b))
#define MAX(a,b)                max(a,b)
#define MIN(a,b)                min(a,b)
#define fi                      first
#define se                      second
#define mp                      make_pair
#define all(v)                  v.begin(),v.end()
#define Sort(v)                 sort(all(v))
#define Reverse(v)              reverse(all(v))
#define Permute                 next_permutation
#define TC(t)                   while(t--)
#define pb                      push_back
#define pf                      push_front
#define IM                      INT_max
#define IMI                     INT_MIN
void solve(){
    int t;
    cin>>t;
    int sum=0;
    TC(t){
     int k;
     cin>>k;
     if(k/10>0)
         sum=sum+k-10;
    }
    cout<<sum;
}
int main(){

#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}


	/*
ID: ghallya2
TASK: ride
PROG: ride
LANG: C++
*/

#include<cstdio>
#include<iostream>
#include<map>
#include<set>
#include<vector>
#include<cstring>
#include<cassert>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<limits>
#include<ctime>
#include<stack>
#include<bits/stdc++.h>
#include<string>
#include<stdlib.h>
#include<stdio.h>
#include<cstdlib>
#include<unordered_set>
#include<unordered_map>
#include<complex>
#include<chrono>
#include<random>
#include<bitset>
#define forb(i,a,b) for(ll i=a;i<b;i++)
#define fore(i,a,b) for(ll i=a;i<=b;i++)
#define F first
#define S second
#define mp make_pair
#define sortba(a,i,n) sort(a+i,a+n+i)
#define sortra(a,i,n) sort(a+i,a+n+i,greater<int>())
#define sortb(a) sort(a.begin(),a.end())
#define sortr(a) sort(a.begin(),a.end(),greater<ll> ())
#define inf LLONG_MAX
typedef long long int ll;
typedef long double ld;
using namespace std;
const ll M=1e9+7;

ll kombinasi(ll a,ll b){
	ll ans=1,j=1;;
	ll y=max(b,a-b);
	for(ll i=a;i>y;i--){
		ans*=i;
		ans%=M;
		ans/=j;
		j++;
	}
	return ans;
}
void solve(){
}

int main()
{
	//freopen("swap.in", "r", stdin);
	//freopen("swap.out", "w", stdout);
	ll n;
	cin>>n;
	ll a[n];
	forb(i,0,n){
		cin>>a[i];
	}
	ll ans=0;
	forb(i,0,n){
		ll mins=a[i];
		forb(j,i,n){
			mins=min(mins,a[j]);
			ans=max(mins*(j-i+1),ans);
		}
	}
	cout<<ans<<endl;
}

/*
"An anomaly, I'm Muhammad Ali
  Cause I know one day I'm gonna be the"
                - Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size())  cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" ";	cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" ";	cout<<endl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const ll INF = 2e18;
const int inf = 2e9;
const int mod1 = 1e9 + 7;

int main(){
    Shazam;
    int n; cin >> n;
    vector<ll> a(n), b(n);
    get(a);
    get(b);
    ll sum = 0;
    for(int i = 0; i < n; i++){
        sum += (a[i] * b[i]);
    }
    cout <<( sum ? "No" : "Yes") << endl;
    return 0;
}


///******* In the name of Allah *******///

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

#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL);
#define nl '\n'

void Ok()
{
    long int a,b,c,d,e,f,g,h,t,i,j,k,l,m,n,Mn,Mx;
    long int ans_1,ans_2,ans_3,cnt_1,cnt_2,cnt_3,flag_1,flag_2,flag_3,temp,sum;
    double aa,bb,cc,dd,ee,ff,gg;
    char aaa,bbb,ccc,ddd;
    string spc,in,store;

    fastio;

    Mn = 999;
    for(i=1;i<=4;i++)
    {
        cin>>a;
        Mn = min(a,Mn);
    }
    cout<<Mn<<nl;
    return;
}

int main()
{
    Ok();

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
main(){
	string s;cin>>s;
	for (int i = 0; i < s.size(); ++i)
	{
		/* code */
		if(s[i]=='.'){
			cout<<s.substr(0,i);
			break;
		}
          	if(i==s.size()-1)cout<<s;
	}
}


#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++)
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
char buf[1<<23],*p1=buf,*p2=buf;
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
const int yuzu=2e5;
typedef int fuko[yuzu|10];
fuko a;
int main() {
  for (int t=read();t--;) {
  	int i,n=read();
  	for (i=1;i<=n;++i) a[i]=read();
  	sort(a+1,a+n+1);
  	if (n&1) puts("Second");
  	else {
	  int lxy=0;
  	  for (i=1;i<=n;i+=2) lxy|=a[i]^a[i+1]?1:0;
  	  puts(lxy?"First":"Second");
	}
  }
}

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

vector<int> in(200005, 0);
vector<int> out(200005, -1);
vector<vector<int>> in_D(200005);
int cnt = 0;

void dfs(int v, int d, vector<vector<int>> &G) {
    in[v] = cnt;
    in_D[d].push_back(in[v]);
    cnt++;

    for (auto &nv : G[v]) {
        dfs(nv, d + 1, G);
    }

    out[v] = cnt;
    cnt++;
}

int main() {
    int n;
    cin >> n;
    vector<int> p(n);  // 0が根
    rep(i, n - 1) {
        cin >> p[i + 1];
        p[i + 1]--;
    }
    int q;
    cin >> q;
    vector<int> u(q), d(q);
    rep(i, q) {
        cin >> u[i] >> d[i];
        u[i]--;
    }

    vector<vector<int>> G(n);
    rep(i, n - 1) { G[p[i + 1]].push_back(i + 1); }
    dfs(0, 0, G);

    rep(i, q) {
        int ans = lower_bound(in_D[d[i]].begin(), in_D[d[i]].end(), out[u[i]]) -
                  lower_bound(in_D[d[i]].begin(), in_D[d[i]].end(), in[u[i]]);
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

int main() {
  long long n, m, sum, min = MAX64, a = 0, b = 0, c = 0, ind;
  cin >> n >> m;
  vector<long long> h(n), w(m), dp(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> w[i];
  }
  sort(h.begin(), h.end());
  h.push_back(MAX64);
  for (int i = 0; i < n; i++) {
    if (i >= 2) {
      c = dp[i - 2];
    }
    if (i % 2) {
      dp[i] = h[i] - a + c;
      b = h[i];
    } else {
      a = h[i];
      dp[i] = h[i] - b + c;
    }
  }
  for (int i = 0; i < m; i++) {
    ind = lower_bound(h.begin(), h.end(), w[i]) - h.begin();
    if (ind >= 2) {
      b = 1;
    } else {
      b = 0;
    }
    if (ind % 2) {
      sum = b * dp[ind - 2] + w[i] - h[ind - 1] + dp[n - 1] - dp[ind - 1];
    } else {
      sum = b * dp[ind - 1] + h[ind] - w[i] + dp[n - 1] - dp[ind];
    }
    if (min > sum) {
      min = sum;
    }
  }
  cout << min << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 2e5 + 5;
const int maxk = 300 + 5;
template<class T> void print(T & x){ cout << x; }
template<class T,class U> void print(pair<T,U> & p){cout << "("; print(p.first); cout << ", "; print(p.second); cout << ")"; }
template<class T> void print(vector<T> & v) {
    cout << "{";
    if (sz(v)) print(v[0]);
    for (int i = 1; i < sz(v); i++) cout << ", ", print(v[i]);
    cout << "}\n";
}

const int MOD = 998244353;
const int inv2 = (MOD + 1) / 2;

ll A[maxn], f[maxk], rf[maxk], sum[maxk], p[maxk], inv[maxk], pb[maxk], self[maxn][maxk];

inline ll add(ll a, ll b) { // 带减法
    return ((a + b) % MOD + MOD) % MOD;
}
inline ll mul(ll a, ll b) {
    return (a * b) % MOD;
}
ll c(int n, int k) {
    return (k < 0 || k > n) ? 0 : mul(f[n], mul(rf[n-k], rf[k]));
}
ll fpow(ll a, ll n) {
    a %= MOD;
    ll ret = 1;
    for (; n; n >>= 1, a = mul(a, a) )
    	if (n & 1) ret = mul(ret, a);
    return ret;
}
int n, m;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    for (int i = 1;i <= n; ++i) {
        cin >> A[i];
    }
    inv[0] = inv[1] = 1;
    for(int i = 2; i <= max(2,m); ++ i) {
        inv[i]=(ll)(MOD-MOD/i)*inv[MOD%i]%MOD;
    }
    f[0] = rf[0] = 1;
    for (int i = 1;i <= m; ++i) {
        f[i] = mul(f[i-1], i);
        rf[i] = mul(rf[i-1], inv[i]);
    }
    for (int i = 1;i <= n; ++i) {
        self[i][0] = 1;
        for (int k = 1;k <= m; ++k) {
            self[i][k] = mul(self[i][k-1], A[i]);
        }
    }
    for (int k = 0;k <= m; ++k) {
        p[k] = 0;
        for (int i = 1;i <= n; ++i) {
            p[k] = add(p[k], self[i][k]);
        }
    }
    for (int i = 1;i <= m; ++i) {
        pb[i] = mul(p[i], fpow(2, i));
    }

    for (int x = 1; x <= m; ++x) {
        ll ans = 0;
        for (int i = 0;i <= x; ++i) {
            ans = add(ans, mul(c(x, i), mul(p[i], p[x-i])));
        }
        ans = add(ans, -pb[x]);
        ans = mul(ans, inv2);
        cout << ans << endl;
    }
    return 0;
}


 //----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
typedef    long long                	 ll;
typedef    double              	 ld;
typedef    unordered_set<ll>         	 usll;
typedef    unordered_multiset<ll>    	 umsll;
typedef    multiset<ll>              	 msll;
typedef    set<ll>                  	 sll;
typedef    vector<ll>               	 vll;
typedef    pair<ll,ll>              	 pll;
typedef    vector<pll>              	 vpll;
typedef    priority_queue<ll>       	 pqll;
typedef    vector<int>              	 vi;
typedef    set<int>                 	 si;
typedef    multiset<int>            	 msi;
typedef    unordered_multiset<int>  	 umsi;
typedef    unordered_set<int>       	 usi;
typedef    pair<int,int>               	 pi;
typedef    vector<pi>                	 vpi;
typedef    priority_queue<int>       	 pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_si;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_sll;
typedef    tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_msi;
typedef    tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_msll;
#define    in          		insert
#define    fi          		first
#define    se          		second
#define    pb   	    	push_back
#define    mp   	   		make_pair
#define    be   	   		begin
#define    en   	   		end
#define    itr  	   		iterator
#define    io  	       		ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   	   		1000000007
#define    inf  	   		8222372026854775807
#define    ninf   	   		-inf
#define    ima   	   		2047483647
#define    imi   	   		-ima
#define    oncnt       		__builtin_popcount
#define    zerobegin   		__builtin_clz
#define    zeroend    		__builtin_ctz
#define    parity      		__builtin_parity
#define    eps         		1e-9
#define    coutd       		cout<<setprecision(6)<<fixed
#define    mems(dp,x)  		memset(dp,x,sizeof(dp))
#define    fbo         		find_by_order
#define    ook    	   		order_of_key
#define    all(x)      		x.be(),x.en()
#define    upb    	   		upper_bound
#define    lowb  	   		lower_bound
#define    lte(v,x)    		(upb(all(v),x)-v.be())
#define    gte(v,x)    		(v.end()-lowb(all(v),x))
#define    gt(v,x)     		(v.en()-upb(all(v),x))
#define    lt(v,x)     		(lowb(all(v),x)-v.be())
const      ld PI= 			3.1415926535897932384626433832792884197169399375105820974944;
inline ll mpow(ll x,ll n){if(n==0)return 1;if(x==0)return 0;if(n==1)return(x%mo);ll u=(mpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll minv(ll x){return mpow(x,mo-2);}
inline ll mmul(ll a,ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=minv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}
inline ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int main()
{              io
int testcases=1;            //       cin>>testcases;
while(testcases--)
{

ll m,h;
cin>>m>>h;
if(h%m)cout<<"No";
else cout<<"Yes";

}return 0;}

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

int main() {
  int m , h ;
  cin >> m >> h ;
  if( h % m == 0 )cout << "Yes" << endl ;
  else cout << "No" << endl;
}


#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    string s;
    cin >> s;
    if(s[0] == s[1] && s[1] == s[2]) puts("Won");
    else puts("Lost");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define tezi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define all(c) c.begin(),c.end()
#define ll long long
#define ull unsigned long long
#define traverse(c,it) for(auto it=c.begin();it!=c.end();it++)
#define lowerb(v,a) lower_bound(v.begin(),v.end(),a)
#define lowerbarr(v,n,a) lower_bound(v,v+n,a)
#define upperb(v,a) upper_bound(v.begin(),v.end(),a)
#define upperbarr(v,n,a) upper_bound(v,v+n,a)
#define maxval(v) max_element(v.begin(),v.end())
#define maxarr(v,n) max_element(v,v+n)
#define minval(v) min_element(v.begin(),v.end())
#define minarr(v,n) min_element(v,v+n)
#define sz(a) (ll)a.size()
#define fr first
#define se second
#define PI 3.1415926536
#define vi vector<int>
#define pii pair<int,int>
#define mem0(v) memset(v,0,sizeof(v))
#define memf(v) memset(v,false,sizeof(v))
#define memt(v) memset(v,true,sizeof(v))
#define mem(v,a) memset(v,a,sizeof(v))
#define npos string::npos
#define MAX 300000
#define MOD 998244353
#define precision(x) setprecision(x)
#define mp make_pair
// #define inf (ll)1e5

                   /**************SIEVE****************/

bool prime[MAX+1];
vector<ll> v;
void sieve(){
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.

    memset(prime, true, sizeof(prime));

    for (long p=2; p*p<=MAX; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p greater than or
            // equal to the square of it
            // numbers which are multiple of p and are
            // less than p^2 are already been marked.
            for (long i=p*p; i<=MAX; i += p)
                prime[i] = false;
        }
    }
    for(long p=2;p<=MAX;p++)
    {
      if(prime[p])v.pb(p);
    }

}

                                        /**************gcd****************/

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

                                         /**************POWER****************/
 ll binpow(ll a, ll b) {
    if (b == 0)
        return 1;
    ll res = binpow(a, b / 2)%MOD;
    if (b % 2)
        return (((ll)res * (ll)res %MOD)* (ll)a)%MOD;
    else
        return ((ll)res * (ll)res)%MOD;
}

                                     /**************MAIn****************/

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

int T=1;
 //cin>>T;

 while(T--)
 {

  solve();
 }

  }


#include <bits/stdc++.h>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define L(n) (n << 1)
#define R(n) (n << 1 | 1)
#define print_vector(n) for(auto a0 : n) cout << a0 << ' '; cout << endl;
#define vector_sort(n) sort(n.begin(), n.end())
#define print_array(n, l, r) for(int a0 = l; a0 <= r; a0++) cout << n[a0] << ' '; cout << '\n';
#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define ABS(a) ((a) > 0 ? (a) : -(a))
using namespace std;

template<class T>
istream & operator >> (istream &in, pair<T, T> &p) {
  in >> p.first >> p.second;
  return in;
}

template<class T>
ostream & operator <<(ostream &out, pair<T, T> &p) {
  out << p.first << ' ' << p.second;
  return out;
}

template<class Tuple, std::size_t N>
struct TuplePrinter {
  static void print(ostream &out, const Tuple& t) {
    TuplePrinter<Tuple, N-1>::print(out, t);
    out << ' ' << get<N-1>(t);
  }
};

template<class Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(ostream &out, const Tuple& t) {
    out << get<0>(t);
  }
};

template<class... Args>
ostream & operator <<(ostream &out, const tuple<Args...> &p) {
  TuplePrinter<decltype(p), sizeof...(Args)>::print(out, p);
  return out;
}

int N;
long long A[300005];
map<pll, int> cnt;

int main() {
  ios_base::sync_with_stdio(0);
  cin >> N;
  pll offset = {};
  long long ans = 0;
  for (int i = 1; i <= N; i++) cin >> A[i];

  for (int i = 1; i <= N; i++) {
    pll now = offset;
    pll new_start = offset;
    // cout << offset << "\n";
    if (i & 1) {
      now.second -= A[i];
      // now.first = -now.first;
      // now.second = -now.second;
      ans += cnt[now];

      new_start.first -= A[i];
      cnt[new_start]++;

      offset.second += A[i + 1] - A[i];
    }else {
      now.first -= A[i];
      // now.first = -now.first;
      // now.second = -now.second;
      ans += cnt[now];

      new_start.second -= A[i];
      cnt[new_start]++;

      offset.first += A[i + 1] - A[i];
    }
    // cout <<  " -> " << new_start << "\n";
    // cout <<  " -> " << now << "\n";
  }
  cout << ans << "\n";
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<stdlib.h>
#include<utility>
#include<functional>
#include<cfenv>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define vint vector<ll>
#define vvint vector<vint>
#define P pair<int,int>
#define INT_MAX 2147483647
#define MOD 1000000007
#define PI 3.14159265358979323846
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;

#define MAX 1000000000000

int main(void) {
	unsigned long long x, y, a, b; cin >> x >> y >> a >> b;
	unsigned long long e = 0;
	if(x>=1000000000){
		e += (y - x) / b;
		if ((y - x) % b == 0) {
			e--;
		}
		cout << e << endl;
		return 0;
	}

	while (true) {
		if (a*x < x + b) {
			x *= a;
			e++;
		}
		else {
			break;
		}
		if (x >= y) {
			e--;
			cout << e << endl;
			return  0;
		}
	}
	e += (y - x) / b;
	if ((y - x) % b == 0) {
		e--;
	}
	cout << e << endl;
	return 0;

}


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

// MACROS
#define int                     long long
#define pb                      push_back
#define MAX                     1e17
#define MIN                     -1e17
#define mod                     1000000007
#define eps                     1e-9
#define set(x)                  memset(x, 0, sizeof(x))
#define clr(x)                  memset(x, -1, sizeof(x))
#define ff                      first
#define ss                      second
#define rep(i,a,b)              for(int i=a;i<b;i++)
#define sz(x)                   x.size()
#define endl                    "\n"
#define deb(x)                  cout << #x << "=" << x << endl
#define deb2(x, y)              cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x)                  x.begin(), x.end()
#define lb(a,x)                 lower_bound(all(a),x)
#define ub(a,x)                 upper_bound(all(a),x)

typedef priority_queue<int>     maxHeap;
typedef priority_queue<int,     vector<int>, greater<int>> minHeap;
typedef pair<int, int>          pii;
typedef vector<int>             vi;
typedef vector<string>          vs;
typedef vector<pii>             vpii;
typedef vector<vi>              vvi;
typedef map<int, int>            mpii;
typedef set<int>                seti;
typedef multiset<int>           mseti;
template<typename T>
using pbds = tree<T , null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update>;
template<typename T, typename T1>T amax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T amin(T &a, T1 b) {if (b < a)a = b; return a;}
// typedef long long int           ll;

// cout << fixed << setprecision(9) <<
int mpow(int base, int exp);

const int T2 = 105; const int T3 = 1005; const int T4 = 10005; const int T5 = 100005;
const int N = 3e5;

int arr[N];

void solve() {
    long double x, y, r;
    cin >> x >> y >> r;
    r = nextafter(r, INFINITY);
    int ans = 0;
    for (int i = ceil(x - r); i <= floor(x + r); i++) {
        long double tmp = sqrt(r * r - (x - i) * (x - i));
        int from = ceil(y - tmp), to = floor(y + tmp);
        ans += to - from + 1;
    }

    cout << ans;

}

/* TIPS
1. for interactive prob remove fastio and endl
2. for vector pass as reference
3. dont use set and clr when n * t is very large use loop till n instead.
4.

*/

int32_t main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; i++) {

        // cout<<"Case #"<<i<<": ";

        solve();

    }
    return 0;
}

int mpow(int base, int exp) {
    base %= mod;
    int result = 1;
    while (exp > 0) {
        if (exp & 1) result = ((int)result * base) % mod;
        base = ((int)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
 /*   ios::sync_with_stdio(false);
    cin.tie(0);*/
    double x,y,X,Y;
    cin>>x>>y>>X>>Y;
    double ans,d;
    d=y*(X-x)/(Y+y);
    ans=x+d;
    cout <<fixed<<setprecision(6)<<ans<<"\n";

    return 0;

}


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

int main(){
  int N, K;
  cin >> N >> K;
  cout << (100 * N + K + 101) * N * K / 2 << endl;
  return 0;
}

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

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

    int total = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= k; j++) {
            total += (i * 100 + j);
        }
    }
    cout << total;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  char S[10];
  int i;
  cin >> S;

  for(i=0; i<3; i++)
  {
      cout << S[1] << S[2] << S[0];
      break;

  }

   return 0;
}

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

int main(){
    string ss;
    cin>>ss;

    string p,t;
    p[0]=ss[1];
    p[1]=ss[2];
    p[2]=ss[0];

    for(int i=0;i<=2;i++){
        t += p[i];
    }

    cout<<t;

    return 0;
}


#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
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 long long INF = 1LL <<60;
const long long  MOD = 1000000007;
typedef long long ll;
using namespace std;

ll gcd(ll m,ll n){
    if(n==0) return m;
    return gcd(n,m%n);
}

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

    int ans;

    rep(i,1,b){
        int tmp = 0;
        if(b / i > 1) tmp = b / i;
        else break;

        if(i * (tmp - 1) >= a && i * (tmp - 1) <= b) ans = i;
    }

    cout << ans << endl;

    return 0;
}

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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)
#define DEB(x)	cout << #x << " " << x << endl;
#define DEB_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

typedef long long int LL;
typedef pair<int, int> PI;
typedef pair<LL, LL> PLL;
typedef pair<int, PI> PPI;

typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<vector<int>> VVI;

void solve() {
	int a, b;
	cin >> a >> b;

	FORR(i, 1, b) {
		int ra = max(i, a);
		int k =  ra / i;
		int proda = i*k;

		if (proda < a)
			proda = i*(++k);

		if (proda > b)
			continue;

		int prodb = i*(k+1);
		if (prodb >= a && prodb <= b) {
			cout << i << endl;
			return;
		}
	}
}

int main() {

	IOS

	// int t;
	// cin >> t;

	// while (t--) {
	    solve();
	// }

	return 0;
}


// Copyright 2020 Tsutomu ISHIKAWA
// Author: Tsutomu ISHIKAWA

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

// DPテーブル
int x;

int main() {
  cin >> x;
  if (x < 0) {
    cout << 0 << endl;
    return 0;
  }
  else {
     cout << x << endl;
     return 0;
  }
}

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

int main()
{
	int n;cin >> n;
	n = max(n,0);
	cout<< n<< endl;
}


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

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

    li n;
    cin >> n;
    vector<li> xs(n);
    for (int i = 0; i < n; ++i) {
        cin >> xs[i];
    }
    li ans = xs[0];
    for (int i = 0; i < n; ++i) {
        ans = __gcd(ans, xs[i]);
    }
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using u64 = uint_least64_t;
using s64 = int_least64_t;
using ll = uint_least64_t;

int main(){
    u64 n;
    cin >> n;
    vector<u64> a(n);
    for (u64 i = 0; i < n; i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    // a.erase(unique(a.begin(), a.end()), a.end());

    u64 sum;
    for (u64 i = 0; i < a.size(); i++){
        if (i == 0){
            sum = a[i]%1000000007 +1;
        }else{
            sum *= a[i]%1000000007 - a[i - 1]%1000000007+1;
            sum = sum % 1000000007;
        }
    }
    cout << sum << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef unsigned int uint;
typedef unsigned long long ull;
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, n) repi(i, 0, n)
#define repir(i, a, b) for(int i = int(a); i > int(b); i--)
#define repr(i, n) repir(i, n - 1, 0)
#define INF 1000000000
#define INF_LL 4000000000000000000
#define all(x) (x).begin(), (x).end()
#define UNI(x) (x).erase(unique(all(x)),(x).end())
#define F first
#define S second
#define MP make_pair
#define MT make_tuple
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    string a, b;
    cin >> a >> b;
    int sa = 0;
    int sb = 0;
    rep(i, a.length()){
        sa += a[i] - '0';
    }
    rep(i, b.length()){
        sb += b[i] - '0';
    }
    cout << max(sa, sb) << endl;
}


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

// #include <ext/pb_ds/assoc_container.hpp> //required
// #include <ext/pb_ds/tree_policy.hpp> //required

// using namespace __gnu_pbds; //required

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

// ordered_set <int> s;
// s.find_by_order(k); returns the (k+1)th smallest element
// s.order_of_key(k); returns the number of elements in s strictly less than k

#pragma GCC optimize("-Ofast")
#pragma GCC optimize("trapv")
#pragma GCC target(                                                            \
	"sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
#define mod (1000000000+7)
#define pii pair<ll, ll>
#define vi vector<int>
#define vvi vector<vector<int>>
#define f first
#define s second
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define all(x) x.begin(), x.end()
#define print(vec, l, r)                                                       \
	for (int i = l; i <= r; i++)                                               \
		cout << vec[i] << " ";                                                 \
	cout << endl;
#define forf(i, a, b) for (int i = (a); i < (b); i++)
#define forr(i, a, b) for (ll i = (a); i > (b); i -= 1)
#define input(vec, N) for (int i = 0; i < (N); i++) cin >> vec[i];
typedef long long ll;
#define ld long double
const int N = 1<<18;
const int MAXK = 12;
const ll INF = 2000000000000000000;

const int RANDOM =
	chrono::high_resolution_clock::now().time_since_epoch().count();
// struct chash {
//     int operator()(int x) const { return x ^ RANDOM; }
// };
// gp_hash_table<int, unsigned long long, chash> m[12];

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

ll modInverse(ll a, ll m = mod) {
	return expo_pow(a, m - 2);
}

void solve (int te){
    string s;
    cin>>s;

    int cnt[10];
    memset(cnt,0,sizeof(cnt));
    for(auto x : s){
      cnt[x-'0']++;
    }

    forf(i,100,1000){
      if(i%8==0){
        int tcnt[10];
        forf(i,0,10) tcnt[i] = cnt[i];

        int j = i;
        int f=0;
        while(j){
          if(!tcnt[j%10]){
            f=1;
            break;
          }
          else tcnt[j%10]--;
          j/=10;
        }
        if(!f){
          cout<<"Yes"<<'\n';
          return;
        }
      }
    }

    forf(i,0,100){
      if(i%8==0){
        int tcnt[10];
        forf(i,0,10) tcnt[i] = cnt[i];

        int j = i;
        int f=0;
        while(j){
          if(!tcnt[j%10]){
            f=1;
            break;
          }
          else tcnt[j%10]--;
          j/=10;
        }

        forf(i,0,10){
          if(tcnt[i]){
            f=1;
            break;
          }
        }

        if(!f){
          cout<<"Yes"<<'\n';
          return;
        }
      }
    }

    cout<<"No"<<'\n';

}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int T = 1;
	// freopen("f.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	//cin >> T;
  int t=1;
	// sieve();
	while (t<=T) {
		solve(t);
    t++;
	}
}

#include <bits/stdc++.h>

using namespace std;

typedef long long          ll;
typedef unsigned long long ull;
typedef vector<int>         vi;
typedef vector<bool>       vb;
typedef map<int, int>      mii;
typedef pair<int, int>     ii;

#define INF                0x3f3f3f3f
#define INFLL              0x3f3f3f3f3f3f3f3f
#define each(x, s)         for(auto& x : s)
#define loop(x)            for(int i = 0;i < x;i++)
#define vloop(v, x)        for(int v = 0;v < x;v++)
#define avg(l, r)          l + (r - l) / 2
#define iter(a)            a.begin(), a.end()
#define riter(a)           a.rbegin(), a.rend()
#define endl               "\n"

const ll mod = 1000000007;

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

  vi start = {0, 8, 16, 104};
  string s;
  cin >> s;
  vi cnt(10, 0), cnt2(10, 0);
  each(c, s) cnt[c - '0']++;
  bool ok = false;
  int n = s.length();
  for (int i = start[min(n, 3)];i < 1000 and !ok;i += 8) {
    string t = to_string(i);
    each(c, t) {
      cnt2[c - '0']++;
    }
    if (!cnt2[0]) {
      ok = true;
      loop(10) {
        if (cnt2[i] > cnt[i]) ok = false;
      }
    }
    each(c, t) cnt2[c - '0']--;
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}


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

int main()
{
    size_t N, M;
    cin >> N >> M;

    vector<int> A(M + 2, 0);
    for (size_t i = 1; i <= M; i++)
    {
        cin >> A[i];
    }
    A.back() = N + 1;
    sort(A.begin(), A.end());

    map<int, size_t> count;
    int minimum = N;
    for (size_t i = 0; i <= M; i++)
    {
        if (A[i] + 1 == A[i + 1])
        {
            continue;
        }
        minimum = min(A[i + 1] - A[i] - 1, minimum);
        count[A[i + 1] - A[i] - 1]++;
    }
    int ans = 0;
    for (pair<int, size_t> c : count)
    {
        ans += (c.first + (minimum - 1)) / minimum * c.second;
    }
    cout << ans << endl;
}

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

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

const int bm = 200001;
int BIT[bm];
void add(int A) {
	while (A > 0) {
		BIT[A]++;
		A -= A & -A;
	}
}
int query(int A) {
	int ret = 0;
	while (A <= bm) {
		ret += BIT[A];
		A += A & -A;
	}
	return ret;
}
ll tmp[200001];
void pakuri_sort(int N, ll A[]) {
	const int b = 8;
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

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

	int N;
	cin >> N;
	ll A[200000], B[200000];
	rep1(i, N) cin >> A[i];
	rep1(i, N) cin >> B[i];
	rep1(i, N) A[i] += i * (1ll << 32 | 1);
	rep1(i, N) B[i] += i * (1ll << 32 | 1);

	pakuri_sort(N, A + 1);
	pakuri_sort(N, B + 1);

	rep1(i, N) {
		if ((A[i] ^ B[i]) & (1ll << 32) - 1) {
			co(-1);
			return 0;
		}
		tmp[A[i] >> 32] = B[i] >> 32;
	}
	ll kotae = 0;
	rep1(i, N) {
		kotae += query(tmp[i]);
		add(tmp[i]);
	}
	co(kotae);

	Would you please return 0;
}


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

#define fi first
#define se second
#define rng(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); --i)
#define per(i, b) gnr(i, 0, b)
#define all(obj) begin(obj), end(obj)
#define allr(obj) rbegin(obj), rend(obj)
#define cinv(a) rep(i, (int)a.size()) cin >> a[i]
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<Pi> vp;
typedef vector<vp> vvp;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;

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; }
template <typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const int di[] = {0, -1, 0, 1};
const int dj[] = {1, 0, -1, 0};
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e15;
const long double eps = 1e-10;
const char nl = '\n';

ll power(ll a, ll b) { return b ? power(a * a % MOD, b / 2) * (b % 2 ? a : 1) % MOD : 1; }

ll C(int n, int k)
{
	ll x = 1, y = 1;
	for (int i = 1; i <= k; ++i)
	{
		x = x * (n - i + 1) % MOD;
		y = y * i % MOD;
	}
	return x * power(y, MOD - 2) % MOD;
}

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n; cin >> n;
	double x0, y0, xn, yn; cin >> x0 >> y0 >> xn >> yn;
	complex<double> a{x0, y0}, b{xn, yn};
	auto o = (a+b)/2.0;
	double angle = 2*M_PI/n;
	complex<double> c{cos(angle), sin(angle)};
	auto ans = o + (a-o)*c;
	cout << ans.real() << " " << ans.imag() << nl;
}

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

using namespace std;

struct Node
{
    int id;
    long long int c;
    long long int diff;
    int depth;
    vector<Node *> next;
};

void travel(Node *curr, long long int currentDiff, Node *from = nullptr)
{
    currentDiff += curr->diff;
    curr->c = currentDiff;

    for(auto &n : curr->next)
    {
        if(n != from)
            travel(n, currentDiff, curr);
    }
}

void setDepth(Node *curr, Node *from = nullptr)
{
    if(from == nullptr)
        curr->depth = 0;
    else
        curr->depth = from->depth + 1;

    for(auto &n : curr->next)
    {
        if(n != from)
            setDepth(n, curr);
    }
}

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

    auto nodes = vector<Node>(N);
    auto edges = vector<pair<int,int>>(N-1);

    int id = 1;
    for(auto& n : nodes)
    {
        n.id = id++;
        n.next = vector<Node *>();
        n.diff = 0;
        n.c = 0;
    }

    for(auto& e : edges)
    {
        int a, b;
        cin >> a >> b;

        a--;
        b--;

        e.first = a;
        e.second = b;
        nodes[a].next.push_back(&nodes[b]);
        nodes[b].next.push_back(&nodes[a]);
    }

    // set depth, nodes[0] is root
    Node *root = &nodes[0];
    setDepth(root);

    cin >> Q;

    for(int i = 0; i < Q; i++)
    {
        int t, e, x;
        int start, goal;
        cin >> t >> e >> x;

        e--;
        Node *a = &(nodes[edges[e].first]);
        Node *b = &(nodes[edges[e].second]);

        if(t == 2)
            swap(a, b);

        if( a->depth >= b->depth )
        {
            a->diff += x;
        }
        else
        {
            root->diff += x;
            b->diff -= x;
        }
    }

    long long int currentDiff = 0;
    travel(root, currentDiff);

    for(auto n : nodes)
    {
        cout << n.c << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

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

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n;
    string s,t;
    cin >> n;
    rep(i,n){
        char hoge;
        cin >> hoge;
        s.push_back(hoge);
    }
    rep(i,n){
        char hoge;
        cin >> hoge;
        t.push_back(hoge);
    }
    int q;
    cin >> q;
    rep(_,q){
        int T,a,b;
        cin >> T >> a >> b;
        a--;b--;
        if(T==1){
            if(b < n){
                swap(s[a],s[b]);
            }else if(a>=n){
                swap(t[a-n],t[b-n]);
            }else{
                swap(s[a],t[b-n]);
            }

        }
        else{
            swap(s,t);
        }
    }
    cout << s << t << endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,c;
 cin >> a >> b >> c;
if(a==b) cout << c << endl;
 else if(b==c) cout << a << endl;
 else if(a==c) cout << b << endl;
 else cout << 0 << endl;
 return 0;
}


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

int main() {
  long long n;
  cin >> n;
  vector<bool> s(n);
  for(int i = 0; i < n; i++){
    string now;
    cin >> now;
    if(now == "AND") s.at(i) = true;
    else s.at(i) = false;
  }

  long long ans = 1;
  reverse(s.begin(), s.end());
  for(long long i = 0; i < n; i++){
    if(s.at(i)) continue;
    long long sum = 1;
    for(int j = 0; j < n-i; j++) sum *= 2;
    ans += sum;
  }

  cout << ans << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n;
    cin>>n;
    n=1<<n;
    ll left=0,right=0;
    map<ll,ll>mp;
    ll a[n+1];
    for(ll i=1; i<=n; i++)
    {
        cin>>a[i];
        mp[a[i]]=i;
    }
    for(ll i=1; i<=n; i++)
    {
        if(i<=n/2)
            left=max(left,a[i]);
        else
            right=max(right,a[i]);
    }
    if(left<right)
        cout<<mp[left]<<endl;
    else
        cout<<mp[right]<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
	cin>> n;
	for (int i=0; i<n; ++i) {
		cout<< (i*2)%n+1 << " " << (i*2+1)%n+1 <<endl; }
	return 0; }

#include<bits/stdc++.h>
using namespace std;
unsigned long long n,k,sum,l;
unsigned long long cf(unsigned long long x,unsigned long long y)
{
	unsigned long long ans=1;
	for(int i=1;i<=y;i++)
	{
		ans*=x;
	}
	return ans;
}
int main()
{
	scanf("%llu",&n);
	k=n;
	int p;
	for(int i=1;;i++)
	{
		if(k==0) break;
		k/=10;
		p++;
	}
	int m=(p-1)/3;
	for(int i=1;i<=m;i++)
	{
		sum+=(n+1-cf(1000,i));
	}
	cout<<sum<<endl;
	return 0;
}


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

const ll INF = 1e18;
const ll NEGINF = -1 * INF;

/*NOTES: Take care of ll vs int
         Never use an iterator after erasing it
*/

const int N = 2e5 + 5;
vector<array<ll, 2>> adjList[N];
ll dist[N];

void dfs(int currNode, int parent, ll currDist)
{
    dist[currNode] = currDist;
    for (array<ll, 2> v : adjList[currNode])
    {
        if (v[0] != parent)
        {
            dfs(v[0], currNode, currDist ^ v[1]);
        }
    }
}

ll my_pow(ll a, ll n, ll m = INF)
{
    ll res = 1;
    while (n)
    {
        if (n % 2)
        {
            res = (res * a) % m;
            n--;
        }
        a = (a * a) % m;
        n /= 2;
    }
    return res;
}

void solve()
{
    int n;
    cin >> n;
    ll u, v, w;
    for (int i = 0; i < n - 1; i++)
    {
        cin >> u >> v >> w;
        u--;
        v--;
        adjList[u].push_back({v, w});
        adjList[v].push_back({u, w});
    }
    dfs(0, -1, 0ll);
    ll ans = 0;
    for (ll i = 0; i < 60; i++)
    {
        ll cntOnes = 0;
        ll cntZeros = 0;
        for (int j = 0; j < n; j++)
        {
            if (dist[j] & (1ll << i))
            {
                cntOnes++;
            }
            else
            {
                cntZeros++;
            }
        }
        ll totCnt = (cntOnes * cntZeros) % mod;
        ans = (ans + ((1ll << i) % mod * totCnt) % mod);
    }
    ans = ans % mod;
    //ans = (ans % mod * my_pow(2, mod - 2, mod) % mod) % mod;
    cout << ans << endl;
}

int main()
{
    fast;
#ifndef ONLINE_JUDGE
    freopen("/home/kalit/Desktop/Data Structures-Algo-Competitive/src/codeforces/input.txt", "r", stdin);
    freopen("/home/kalit/Desktop/Data Structures-Algo-Competitive/src/codeforces/output.txt", "w", stdout);
#endif
    int T = 1;
    while (T--)
    {
        solve();
    }
    //cout<< "Done in " << clock() / CLOCKS_PER_SEC <<"sec"<< endl;
    return 0;
}

// I SELL YOU...!
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
const ll MOD = 998244353;
const ll MAX = 5100;
bool can[MAX][MAX][3];
ll dp[MAX][MAX]={};
ll modinv(ll a, ll m){
  ll b=m,u=1,v=0;
  while(b){
    ll t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  u%=m;
  if(u<0) u+=m;
  return u;
}
signed main(){
  init_io();
  ll H,W,K,fi=1,mv;
  cin >> H >> W >> K;
  mv = modinv(3,MOD);
  vector<ll> h(K),w(K);
  vector<char> c(K);
  for(int i=0;i<MAX;i++){
    for(int j=0;j<MAX;j++){
      for(int k=0;k<3;k++){
        can[i][j][k] = true;
      }
    }
  }
  for(ll i=0;i<H*W-K;i++){
    fi *= 3;
    fi %= MOD;
  }
  for(int i=0;i<K;i++){
    cin >> h[i] >> w[i] >> c[i];
    h[i]--;
    w[i]--;
    for(int j=0;j<3;j++){
      can[h[i]][w[i]][j] = false;
    }
    if(c[i]=='R') can[h[i]][w[i]][0] = true;
    if(c[i]=='D') can[h[i]][w[i]][1] = true;
    if(c[i]=='X') can[h[i]][w[i]][2] = true;
  }
  dp[0][0] = 1;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      ll nv = dp[i][j];
      if(can[i][j][0]&&can[i][j][1]&&can[i][j][2]){
        nv = (nv*2*mv);
        nv %= MOD;
        dp[i][j+1] = (dp[i][j+1]+nv)%MOD;
        dp[i+1][j] = (dp[i+1][j]+nv)%MOD;
      }else if(can[i][j][0]){
        dp[i][j+1] = (dp[i][j+1]+nv)%MOD;
      }else if(can[i][j][1]){
        dp[i+1][j] = (dp[i+1][j]+nv)%MOD;
      }else if(can[i][j][2]){
        dp[i][j+1] = (dp[i][j+1]+nv)%MOD;
        dp[i+1][j] = (dp[i+1][j]+nv)%MOD;
      }
    }
  }
  cout << (dp[H-1][W-1]*fi)%MOD << endl;
}


#include<iostream>
#include<vector>
#include<cmath>
 #include<iomanip>
#define int long long
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infi INT_MAX
#define rinfi INT_MIN
#define inf LLONG_MAX
#define rinf LLONG_MIN
#define ff first
#define ss second
#ifndef ONLINE_JUDGE
#define line cout<<"here - "<<__LINE__<<"\n";
#define dbg(a) cout<<#a<<" --> "<<(a)<<"\n";
#define db(a,b) cout<<#a<<" --> "<<(a)<<"\n";cin>>b;
#else
#define line
#define dbg(a)
#define db(a,b)
#endif
char _;
using namespace std;
const int mx=2e5+10;
main()
{
//    fast
    int tc=1,i,j,k;
//    cin>>tc;
    while(tc--)
    {
      int n,w;
      cin>>n>>w;
      int s,t,p;
      vector<int>aa(mx,0);
      for(i=0;i<n;i++)
      {
          cin>>s>>t>>p;
          aa[s]+=p;
          aa[t]-=p;
      }
      int ok=1;
      for(i=0;i<mx;i++)
      {
          if(i)
            aa[i]+=aa[i-1];
          if(aa[i]>w)
            ok=0;
      }
      if(ok)
        cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }
}

#include <bits/stdc++.h>

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

using namespace std;

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

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

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

    int n;
    ll w;
    cin >> n >> w;

    ll sp[200010], tp[200010];
    FILL0(sp);
    FILL0(tp);
    int tmax = 0;
    rep(i, n)
    {
        int s, t;
        ll p;
        cin >> s >> t >> p;
        chmax(tmax, t);
        sp[s] += p;
        tp[t] += p;
    }

    ll water = 0;
    rep(i, tmax + 2)
    {
        water += sp[i];
        water -= tp[i];
        if (water > w)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}