#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a)
#define dumparr(a,n)
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

pll operator+(pll a,pll b){
  return pll(a.first+b.first,a.second+b.second);
}
pll operator-(pll a,pll b){
  return pll(a.first-b.first,a.second-b.second);
}
pll operator*(ll a,pll b){
  return pll(b.first*a,b.second*a);
}
const ll INF=(1LL<<60);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  a=abs(a);
  b=abs(b);
  if(a==0)return b;
  if(b==0)return a;
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

void solve(long long A, long long B){
  long double ans=100*(A-B)/(long double)A;
  cout<<ans<<endl;
}

int main(){
  cout<<setprecision(1000);
  long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
  solve(A, B);
  return 0;
}

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

int main() {
    float A, B;
    cin >> A >> B;
    cout << (A - B) * 100 / A << endl;
    return 0;
}


/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("[DEBUG] ");W(__VA_ARGS__);}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1<<20;
int N;
VPLL e[SIZE];
LL w[SIZE];
void dfs(int x, int lt) {
    for(auto &[y,v]: e[x]) {
        if(y==lt){continue;}
        w[y]=w[x]^v;
        dfs(y,x);
    }
}
LL get_bit(LL x, int v) { return (x >> v) & 1; }
void solve() {
    dfs(1,1);
    int d[60]={};
    FOR(i,1,N){
        REP(j,60)d[j]+=get_bit(w[i],j);
    }
    LL an=0;
    for(int i=59;i>=0;i--){
        an=an*2%MOD;
        an=(an+(LL)d[i]*(N-d[i]))%MOD;
    }
    W(an);
}
void input() {
    R(N);
    REPP(i,1,N){
        int x,y;
        LL v;
        R(x,y,v);
        e[x].PB(MP(y,v));
        e[y].PB(MP(x,v));
    }
}
int main(){
    input();
    solve();
    return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
constexpr int INF = 1e9, MOD = 1e9 + 7;
constexpr int64_t LINF = 5e18, LMOD = 998244353;
// #include <atcoder/all>
// using namespace atcoder;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

using fint64 = int_fast64_t;
template<fint64 MOD>
struct ModInt {
	fint64 x;
	ModInt():x(0){}
	ModInt(fint64 x):
		x(x>=0?x%MOD:(MOD-(-x)%MOD)%MOD)
		{}
	// 負号
	ModInt operator -() const{
		return ModInt(-x);
	}
	// 加算
	ModInt &operator +=(const ModInt &rhs){
		x+=rhs.x;
		if(x>=MOD) x-=MOD;
		return (*this);
	}
	ModInt operator +(const ModInt &rhs) const{
		return ModInt(*this)+=rhs;
	}
	// 減算
	ModInt &operator -=(const ModInt &rhs){
		x+=MOD-rhs.x;
		if(x>=MOD) x-=MOD;
		return (*this);
	}
	ModInt operator -(const ModInt &rhs) const{
		return ModInt(*this)-=rhs;
	}
	// 乗算
	ModInt &operator *=(const ModInt &rhs){
		x*=rhs.x;
		if(x>=MOD) x%=MOD;
		return (*this);
	}
	ModInt operator *(const ModInt &rhs) const{
		return ModInt(*this)*=rhs;
	}
	// 除算
	ModInt &operator /=(const ModInt &rhs){
		(*this)*=rhs.inverse();
		return (*this);
	}
	ModInt operator /(const ModInt &rhs) const{
		return ModInt(*this)/=rhs;
	}
	// 等号
	bool operator ==(const ModInt &rhs){
		return x==rhs.x;
	}
	bool operator !=(const ModInt &rhs){
		return x!=rhs.x;
	}
	// 累乗
	ModInt pow(fint64 n) const{
		fint64 tmp=x;
		fint64 ret=1;
		while(n>0){
			if(n&1) ret=ret*tmp%MOD;
			tmp=tmp*tmp%MOD;
			n>>=1ll;
		}
		return ModInt(ret);
	}
	// 逆元
	ModInt inverse() const{
		fint64 a=x,b=MOD,s=1,t=0;
		while(b>0){
			fint64 u=a/b;
			a-=u*b;
			s-=u*t;
			swap(a,b);
			swap(s,t);
		}
		return ModInt(s);
	}
	// 入出力
	friend istream &operator >>(istream &lhs,ModInt<MOD> &rhs){
		fint64 x; lhs>>x;
		rhs=ModInt<MOD>(x);
		return lhs;
	}
	friend ostream &operator <<(ostream &lhs,const ModInt<MOD> &rhs){
		return lhs<<rhs.x;
	}
};

using mint = ModInt<LMOD>;
mint dp[5010][5010];
mint _3[5010];
int sum_x[5010][5010];
int sum_y[5010][5010];
int com[5010][5010];
int h, w;

int main() {
	int k; cin >> h >> w >> k;
	rep(i,h)rep(j,w) com[i][j] = -1;
	while(k--) {
		int y, x; cin >> y >> x;
		--y, --x;
		char c; cin >> c;
		if(c == 'R') com[y][x] = 0;
		if(c == 'D') com[y][x] = 1;
		if(c == 'X') com[y][x] = 2;
	}
	for(int i = h - 1; i >= 0; --i) {
		for(int j = w - 1; j >= 0; --j) {
			if(j + 1 < w) {
				sum_x[i][j] = sum_x[i][j + 1];
				sum_x[i][j] += (com[i][j + 1] == -1);
			}
		}
	}
	for(int j = w - 1; j >= 0; --j) {
		for(int i = h - 1; i >= 0; --i) {
			if(i + 1 < h) {
				sum_y[i][j] = sum_y[i + 1][j];
				sum_y[i][j] += (com[i + 1][j] == -1);
			}
		}
	}
	_3[0] = 1;
	for(int i = 1; i < 5010; ++i) {
		_3[i] = _3[i - 1] * 3;
	}
	for(int y = h - 1; y >= 0; --y) {
		for(int x = w - 1; x >= 0; --x) {
			if(y == h - 1 and x == w - 1) {
				if(com[y][x] == -1) dp[y][x] = 3;
				else dp[y][x] = 1;
				continue;
			}
			mint ret = 0;
			if(com[y][x] == -1) {
				if(x + 1 < w) ret += dp[y][x + 1] * _3[sum_y[y][x]];
				if(y + 1 < h) ret += dp[y + 1][x] * _3[sum_x[y][x]];
				ret *= 2;
			} else {
				if(com[y][x] == 0) {
					if(x + 1 < w) ret += dp[y][x + 1] * _3[sum_y[y][x]];
				} else if(com[y][x] == 1) {
					if(y + 1 < h) ret += dp[y + 1][x] * _3[sum_x[y][x]];
				} else {
					if(x + 1 < w) ret += dp[y][x + 1] * _3[sum_y[y][x]];
					if(y + 1 < h) ret += dp[y + 1][x] * _3[sum_x[y][x]];
				}
			}
			dp[y][x] = ret;
		}
	}
	cout << dp[0][0] << '\n';
	return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int p[500];

int main() {
    int t, i;

    scanf("%d", &t);

    for (i = 0; i < t; i++) {
        int n, c = 1, j, k;
        vector<int> v;

        scanf("%d", &n);

        for (j = 0; j < n; j++) scanf("%d", &p[j]);

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

            for (k = 0; k < n; k++) {
                if (p[k] == j) {
                    x = k;
                    break;
                }
            }

            if (x == j - 1) continue;

            if (x % 2 != c % 2) {
                if (j == n - 1) {
                    v.push_back(n - 3);
                    v.push_back(n - 2);
                    v.push_back(n - 3);
                    v.push_back(n - 2);
                    v.push_back(n - 3);

                    break;
                } else if (x - 2 >= j - 1) {
                    v.push_back(x - 2);
                    swap(p[x - 2], p[x - 1]);
                    c++;
                } else {
                    v.push_back(x);
                    v.push_back(x - 1);
                    swap(p[x], p[x + 1]);
                    swap(p[x - 1], p[x]);
                    x++;
                }
            }

            while (x > j - 1) {
                v.push_back(x - 1);
                swap(p[x - 1], p[x]);
                c++;
                x--;
            }
        }

        printf("%d\n", v.size());
        for (j = 0; j < v.size(); j++) {
            if (j > 0) putchar(' ');
            printf("%d", v[j] + 1);
        }
        puts("");
    }

    return 0;
}

#include<bits/stdc++.h>

using namespace std;

/**************************************************/
#define int long long
#define fr(i,st,c)          for(int i=st;i<c;i++)
#define rfr(i,e,c)          for(int i=e;i>=c;i--)
#define i_output(f1)        cout<<(f1?"YES":"NO")<<endl;
#define vi                  vector<int>
#define pb                  push_back
#define print(n)            cout<<n<<endl
#define thor                ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define N                   1e9+7

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

/***************************************************/

signed main(){

    thor

    int h,w,x,y;
    cin>>h>>w>>x>>y;

    vector<string> s(h);

    fr(i,0,h){
        cin>>s[i];
    }

    int sum=0;

    x--,y--;

    fr(i,x,h){
        if(s[i][y]=='.'){
            sum++;
        }
        else{
            break;
        }
    }

    rfr(i,x,0){
        if(s[i][y]=='.'){
            sum++;
        }
        else{
            break;
        }
    }
    sum--;
    fr(i,y,w){
        if(s[x][i]=='.'){
            sum++;
        }
        else{
            break;
        }
    }
    sum--;
    rfr(i,y,0){
        if(s[x][i]=='.'){
            sum++;
        }
        else{
            break;
        }
    }
    sum--;

    print(sum);

    return 0;
}


#include<bits/stdc++.h>
#define int long long
#define ri register signed
#define rd(x) x=read()
using namespace std;
const int N=3e5+5;
const int maxn=5e6+5;
const int mod=998244353;
const int inf=0x3f3f3f3f3f3f3f3f;
inline int read(){int x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
inline int ksm(int x,int y=mod-2,int z=mod){int ret=1;while (y){if (y&1) ret=(ret*x)%z;x=(x*x)%z;y>>=1;}return ret;}
int inv[N],fac[N],ifc[N];
void Init(int n)
{
    inv[1]=1;for (ri i=2;i<=n;i++)inv[i]=inv[mod%i]*(mod-mod/i)%mod;
    fac[0]=1;for (ri i=1;i<=n;i++) fac[i]=fac[i-1]*i%mod;
    ifc[0]=1;for (ri i=1;i<=n;i++) ifc[i]=ifc[i-1]*inv[i]%mod;
}
int C(int n,int m){if (m>n || m<0) return 0;return fac[n]*ifc[m]%mod*ifc[n-m]%mod;}
int C(int n,int a,int b){if (a<0 || b<0 || a+b>n) return 0;return fac[n]*ifc[a]%mod*ifc[b]%mod*ifc[n-a-b]%mod;}
int T,n;
int lcm(int a,int b){return a/__gcd(a,b)*b;}
int exgcd(int a,int b,int &x,int &y)
{
    if (!b) {x=1,y=0;return a;}
    int ret=exgcd(b,a%b,y,x);y-=a/b*x;
	return ret;
}
int a[3],r[3];
int excrt()
{
    int M=a[1],R=r[1],x,y,d;
    d=exgcd(M,a[2],x,y);
    if ((R-r[2])%d) return -1;
    x=(R-r[2])/d*x%a[2];
    R-=M*x;
    M=M/d*a[2];
    R%=M;
    return (R%M+M)%M;
}
int x,y,p,q,ans;

signed main()
{
	rd(T);
	while (T--)
	{
		rd(x);rd(y);rd(p);rd(q);
		ans=-1;
		n=(p+q)*(2*x+2*y);
		for (int i=x;i<x+y;i++) for (int j=p;j<p+q;j++)
		{
			r[1]=i;r[2]=j;
			a[1]=2*x+2*y;a[2]=p+q;
			int C=excrt();
			if (C==-1) continue;
			if (ans==-1) ans=C;
			else ans=min(ans,C);
		}
		if (ans==-1) puts("infinity");
		else cout<<ans<<endl;
	}
}

#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
using namespace std;

typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;

template <typename _T>
inline void read(_T &f) {
    f = 0; _T fu = 1; char c = getchar();
    while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar(); }
    while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
    f *= fu;
}

template <typename T>
void print(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x < 10) putchar(x + 48);
    else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
    print(x); putchar(t);
}

const int N = 1005;
const char str[] = " atcoder";

char c[N];
int T, n;

int main() {
    read(T);
    while (T--) {
        scanf("%s", c + 1); n = strlen(c + 1);
        int cando = -1;
        for (int i = 1; i <= min(n, 7); i++) {
            if (c[i] != str[i]) {
                if (c[i] > str[i]) cando = 1;
                else cando = 0;
                break;
            }
        }
        if (cando == 1 || (cando == -1 && n > 7)) {
            printf("0\n");
            continue;
        }
        if (n == 1) {
            printf("-1\n");
            continue;
        }
        if (c[2] != 'a') {
            printf("1\n");
            continue;
        }
        int ans = 100000;
        for (int i = 3; i <= n; i++) {
            if (c[i] > 'a') ans = min(ans, i - 1);
            if (c[i] > 't') ans = min(ans, i - 2);
        }
        if (ans == 100000) ans = -1;
        print(ans, '\n');
    }
    return 0;
}


#include<vector>
#include<cstring>
#include<algorithm>
#include<queue>
#include<iostream>
using namespace std;
int main(){
int a[3];
for(int i=0;i<3;i++) cin>>a[i];
sort(a,a+3);
if(a[2]-a[1]==a[1]-a[0]) cout<<"Yes";
else cout<<"No";

}

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define REP(i,j) for(int i=0;i<j;i++)
#define REPA(i,j) for(int i=1;i<=j;i++)
#define FORN(i,j,k) for(int i=j;i<k;i++)
#define vi vector<int>
#define vvi vector<vi >
#define pii pair<int,int>
#define vpii vector<pii >
#define all(a) a.begin(),a.end()
using namespace std;
const int INF=1<<30;
//const ll INF=1ll<<60;
const ll MOD=1e9+7;
inline void read(int &x){
//	short neg=1;
	x=0;
	char c=getchar();
	/*while(c<'0'||c>'9'){
		if(c=='-')neg=-1;
		c=getchar();
	}*/
	while(c>='0'&&c<='9'){
		x=(x<<3)+(x<<1)+(c^48),c=getchar();
	}
//	x*=neg;
}
ll quick_mod(ll A,ll B){//A^B
    ll ret=1;
    A%=MOD;
    while(B)
    {
        if(B&1)ret=ret*A%MOD;
        B>>=1;
        A=A*A%MOD;
    }
    return ret;
}

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


#include<bits/stdc++.h>
#define ll long long
#define db double
#define M 200006
#define mo 998244353
using namespace std;
bool s1;
char o;
int Read(){
	bool f=1;
	while(!isdigit(o=getchar()))if(o=='-')f=0;
	int res=o^48;
	while(isdigit(o=getchar()))res=(res<<3)+(res<<1)+(o^48);
	return f?res:-res;
}
int n,m,ans,cnt[M][14],len[M],Pow[M<<1],Pow1[M<<1];
bool mark[M];
void Mo(int &a){(a>=mo)&&(a-=mo);}
int fast(int x,int y){
	int res=1;
	while(y){
		if(y&1)res=1ll*res*x%mo;
		y>>=1;
		x=1ll*x*x%mo;
	}
	return res;
}
int C(int a,int b){
	if(a<b)return 0;
	return 1ll*Pow[a]*Pow1[b]%mo*Pow1[a-b]%mo;
}
bool s2;
int main(){
//	printf("%.6lf\n",(&s2-&s1)/1024.0/1024);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=Read(),m=Read();
	for(int i=2;i<=m;++i){
		if(mark[i])continue;
		for(int j=i;j<=m;j+=i){
			mark[j]=1;
			++len[j];
			int a=j;
			while(a%i==0)cnt[j][len[j]]++,a/=i;
		}
	}
	Pow[0]=Pow1[0]=1;
	for(int i=1;i<=n+m;++i)Pow[i]=1ll*Pow[i-1]*i%mo;
	Pow1[n+m]=fast(Pow[n+m],mo-2);
	for(int i=n+m-1;i>=1;--i)Pow1[i]=1ll*Pow1[i+1]*(i+1)%mo;
	for(int i=1;i<=m;++i){
		int res=1;
		for(int j=1;j<=len[i];++j){
			int a=cnt[i][j];
			res=1ll*res*C(n+cnt[i][j]-1,cnt[i][j])%mo;
		}
		Mo(ans+=res);
	}
	printf("%d\n",ans);
	return 0;
}

#include <bits/stdc++.h>

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N;
ll X, Y[60];
ll A[60], B[60];
ll dp[60][10];

ll rec(int i, int c){
    if(i == N - 1){
        return 1;
    }

    if(dp[i][c] != -1){
        return dp[i][c];
    }

    ll res = rec(i + 1, (Y[i] + c) / B[i]);

    if((Y[i] + c) % B[i] > 0){
        res += rec(i + 1, 1);
    }

    return dp[i][c] = res;
}

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

    std::cin >> N >> X;

    for(int i=0;i<N;++i){
        std::cin >> A[i];
    }

    for(int i=0;i+1<N;++i){
        B[i] = A[i+1] / A[i];
    }

    for(int i=N-1;i>=0;--i){
        Y[i] = X / A[i];
        X %= A[i];
    }

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

    ll res = rec(0, 0);
    std::cout << res << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long n;
    cin >> n;
    long long m = n;
    vector<long long> f(88);
    f[0] = f[1] = 1;
    for (int i = 2; i < (int) f.size(); i++) {
        f[i] = f[i - 1] + f[i - 2];
    }
    debug(f);
    vector<int> a(87);
    int k = 0;
    for (int i = 87; i >= 0; i--) {
        if (n >= f[i]) {
            n -= f[i];
            k = max(k, i);
            a[k - i] = 1;
        }
    }
    vector<int> res;
    long long x = 0, y = 0;
    for (int i = 0; i <= k; i++) {
        if (a[i]) {
            res.emplace_back(i % 2);
            if (i % 2 == 0) {
                x++;
            } else {
                y++;
            }
        }
        if (i != k) {
            res.emplace_back(3 - i % 2);
            if (i % 2 == 0) {
                y += x;
            } else {
                x += y;
            }
        }
    }
    debug(x, y);
    if (y == m) {
        for (int i = 0; i < (int) res.size(); i++) {
            res[i] ^= 1;
        }
    }
    cout << res.size() << '\n';
    for (int i : res) {
        cout << i + 1 << '\n';
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, a) for (int i = 0; i < (a); ++i)
#define cont(i, a) for (int i = 1; i <= (a); ++i)
#define circ(i, a, b) for (int i = (a); i <= (b); ++i)
#define range(i, a, b, c) for (int i = (a); (c) > 0 ? i <= (b) : i >= (b); i += (c))
#define parse(it, x) for (auto &it : (x))
#define pub push_back
#define pob pop_back
#define emb emplace_back
#define mak make_pair
#define mkt make_tuple
typedef long long ll;
typedef long double lf;
const int Inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3fll;

mt19937_64 Rand(chrono::steady_clock::now().time_since_epoch().count());
ll n;

ll calc(ll x) {
    ll y = n;
    ll cs = 0;
    while (y) {
        cs += x / y;
        x %= y;
        swap(x, y);
    }
    return cs + x;
}

int main() {
    cin >> n;
    while (1) {
        ll m = uniform_int_distribution<ll>(0, n)(Rand);
        if (calc(m) <= 130) {
            ll x = n, y = m;
            vector<int> ans;
            while (x && y) {
                if (x < y) {
                    y -= x;
                    ans.pub(4);
                }
                else {
                    x -= y;
                    ans.pub(3);
                }
            }
            while (x) --x, ans.pub(1);
            while (y) --y, ans.pub(2);
            reverse(all(ans));
            printf("%d\n", SZ(ans));
            parse(i, ans) printf("%d\n", i);
            return 0;
        }
    }
}


#include <iostream>
#include <bits/stdc++.h>

using namespace std;

long long mod=1e9+7;

long long modpascal=14348907;

int ic(char c){
    if (c=='B') return 0;
    if (c=='R') return 1;
    return 2;
}

char ci(int i){
    if (i==0) return 'B';
    if (i==1) return 'R';
    return 'W';
}

long long pp(long long a, long long b){
    if (b==0) return 1;
    if (b==1) return a;
    if (b%2) return (a*pp((a*a)%modpascal,b/2))%modpascal;
    return pp((a*a)%modpascal,b/2);
}

long long inv(long long x){
    return pp(x,modpascal-2);
}

int ccc[3][3]={{1,0,0},{1,1,0},{1,-1,1}};

int cnk3(int m,int n)
{
    if (n==0) return 1;
    if (m==n) return 1;
    return cnk3(m/3,n/3)*ccc[m%3][n%3];
}

void cmain()
{
    int n;cin>>n;
    long long res=0;
    int mult=-1;
    if (n%2) mult=1;
    char c;
    for (int k=0;k<n;k++){
        cin >> c;
        //cout << n-1 << " " << k << " " << cnk3(n-1,k)<<endl;
        res+=cnk3(n-1,k)*ic(c)*mult;
    }
    res%=3;
    res+=3;
    res%=3;
    cout << ci(res) << endl;
    return;

}

void bmain()
{
    int n;cin>>n;
    set<long> a;
    long ai;
    for (int i=0;i<n;i++){
        cin>>ai;
        a.insert(ai);
    }
    n=a.size();
    vector<long> x={0};
    int i;
    for (set<long>::iterator it=a.begin();it!=a.end();it++){
        x.push_back(*it);
    }
    long long res=1;
    while (x.size()>1){
        long long old=x.back();
        x.pop_back();
        res*=old-x.back()+1;
        res%=mod;
    }
    cout << res << endl;
    return;

}

void amain()
{
    int a,b;cin>>a>>b;
    long cpt=800000;
    long s=0;
    vector<long> x;
    if (a>=b){
        while (a){
            a--;
            s+=cpt;
            x.push_back(cpt);
            cpt++;
        }
        while (b>1){
            cpt--;
            b--;
            s-=cpt;
            x.push_back(-cpt);
        }
        x.push_back(-s);
    }
    else{
        while (b){
            b--;
            s-=cpt;
            x.push_back(-cpt);
            cpt++;
        }
        while (a>1){
            cpt--;
            a--;
            s+=cpt;
            x.push_back(cpt);
        }
        x.push_back(-s);
    }
    for (int i=0;i<x.size();i++){
        cout << x[i] << " ";
    }

    return;
}

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr);
    cmain();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
using vl = vector<ll>;
using vs = vector<string>;
using vvl = vector<vector<ll>>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define MOD 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;

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

bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    ll H,W;
    cin >>H>>W;
    vector<vector<char>>S(H,vector<char>(W));
    ll num=0;
    rep(i,H){
        rep(j,W){
            cin>>S[i][j];
            if(S[i][j]=='.'){
                num++;
            }
        }

    }
    if(num==0){
        cout<<0<<endl;
        return 0;
    }else if(num==1){
        cout<<1<<endl;
        return 0;
    }

    //vvl yoko(H,vector<ll>(W));
    vvl tate(H,vector<ll>(W));

    rep(j,W){
        ll cnt=0;
        ll now=0;
        rep(i,H){
            if(S[i][j]=='#'){
                rep3(k,now,i){
                    tate[k][j]=cnt;
                }
                now=i+1;
                cnt=0;
            }else{
                cnt++;
            }

        }
        rep3(k,now,H){
            tate[k][j]=cnt;
        }
    }

    ll Y=0;
    vvl yoko(H,vector<ll>(W));

    rep(i,H){
        ll cnt=0;
        ll now=0;
        rep(j,W){
            if(S[i][j]=='#'){
                rep3(k,now,j){
                    yoko[i][k]=cnt;
                }
                //Y=(Y+cnt*cnt)%MOD;
                now=j+1;
                cnt=0;
            }else{
                cnt++;
            }

        }
        rep3(k,now,W){
            yoko[i][k]=cnt;
        }
    }

    /*rep(i,H){
        rep(j,W){
            cout<<tate[i][j]<<" ";
        }
        cout<<endl;
    }
    cout<<endl;
    rep(i,H){
        rep(j,W){
            cout<<tate[i][j]<<" ";
        }
        cout<<endl;
    }*/

    ll ans=0;
    rep(i,H){
        rep(j,W){
            if(tate[i][j]+yoko[i][j]-1>=0)
                ans =(ans+modpow(2,num,MOD)-modpow(2,num-(tate[i][j]+yoko[i][j]-1),MOD)+MOD)%MOD;
        }
    }
    /*cout<<num<<endl;*/
    cout<<(ans+MOD)%MOD<<endl;

    return 0;

}


#include <bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

pii irange(const vi64 &a, int x) {
    auto w = equal_range(all(a), x);
    return {w.fi - a.begin(), w.se - a.begin()};
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "rt", stdin);
#endif

    int n, l;
    cin >> n >> l;
    vi64 a = {0}, b = {0};
    forn(i, n) {
        int x;
        cin >> x;
        a.pb(x - i - 1);
    }
    a.pb(l - n);
    forn(i, n) {
        int x;
        cin >> x;
        b.pb(x - i - 1);
    }
    b.pb(l - n);

/*    for (int x: a) cerr << x << ' ';
    cerr << '\n';
    for (int x: b) cerr << x << ' ';
    cerr << '\n';*/

    bool ok = true;
    for (int x: b) {
        ok &= *lower_bound(all(a), x) == x;
    }
    if (!ok) cout << -1 << '\n';
    else {
        i64 ans = 0;
        forn(i, n + 2) {
            if (i + 1 < n + 2 && b[i] == b[i + 1]) continue;
            auto w1 = irange(a, b[i]);
            auto w2 = irange(b, b[i]);
            if (w1.fi > w2.fi) ans += w1.fi - w2.fi;
            if (w1.se < w2.se) ans += w2.se - w1.se;
        }
        cout << ans << '\n';
    }

#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define oo 1000000010
const int N = 100010;
int n , l , a[N] , b[N];

map < int , int > mp , mp2;

int in[N] , it , val , g[N];

/*

pair< int , int > seg[4 * N];

void update(int s,int e,int idx){
	if(s > r || e < l)
		return;
	if(s >= l && e <= r){
		seg[idx] = make_pair(it , val);
		return;
	}
	update(s , ((s+e) >> 1),(idx << 1));
	update(((s+e) >> 1) + 1,e,(idx << 1) + 1);
}

int get(int i){
	int s = 0 , e = n - 1 , idx = 1;
	pair< int , int > ret = make_pair(-1 , -1);
	while(true){
		ret = max(ret , seg[idx]);
		if(s == e)
			break;
		if(i <= ((s + e) >> 1)){
			idx = (idx << 1);
			e = ((s + e) >> 1);
		}
		else{
			idx = (idx << 1) + 1;
			s = ((s + e) >> 1) + 1;
		}
	}
	return ret.second;
}

*/
int main(){
	scanf("%d%d",&n,&l);
	n += 2;
	a[0] = b[0] = 0;
	a[n - 1] = b[n - 1] = l + 1;
	for(int i = 1 ;i < n - 1;i++) scanf("%d",&a[i]);
	for(int i = 1 ;i < n - 1;i++) scanf("%d",&b[i]);
	for(int i = 0 ;i < n;i++){
		if(mp.find(a[i] - i) == mp.end())
			mp[a[i] - i] = i;
		mp2[a[i] - i] = i;
		g[i] = i;
	}
	int cur , mn  , mx;
	for(int i = 1 ;i < n - 1;i++){
		if(b[i] == a[i]) continue;
		if(mp.find(b[i] - i) == mp.end()){puts("-1");return 0;}
		mx = mp2[b[i] - i];
		mn = mp[b[i] - i];
		if(i < mn)
			g[i] = mn;
		else
			g[i] = mx;
	}
	long long ans = 0;
	int j , last;
	for(int i = 0 ;i < n;i++){
		if(g[i] == i) continue;
		if(g[i] < i){
			j = i;
			while(j < n && g[j] < j)
				j++;
			j--;
			last = j;
			for(int k = j ;k >= i;k--){
				if(last == g[k]) continue;
				ans += k - g[k];
				last = g[k];
			}
			i = j;
			continue;
		}
		last = i;
		while(i < n && g[i] > i){
			if(last == g[i]){
				i++;
				continue;
			}
			ans += g[i] - i;
			last = g[i];
			i++;
		}
		i--;
	}
	cout << ans << endl;
	return 0;
}


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

ll n;
vector<ll> divs;

void divisors(ll n) {
  divs.clear();
  for (ll i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      divs.emplace_back(i);
      if (i != n / i) divs.emplace_back(n/i);
    }
  }
  sort(divs.begin(), divs.end());
}

int main() {
  ios::sync_with_stdio(!cin.tie(0));
  cin >> n;
  divisors(n);
  for (int i = 0; i < (int) divs.size(); ++i) {
    cout << divs[i] << "\n";
  }
  return 0;
}

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

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define fef(i,a,b) for(ll i=a;i<=b;i++)
#define rer(i,a,b) for(ll i=b;i>=a;i--)
#define wew while(true)
#define FILE_IN "D.inp"
#define FILE_OUT "D.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define MOD (ll(1000000007))
#define INF (ll(1000000007))
#define MAXN 300011
#define x first
#define y second
#define pii pair<int,int>
#define piii pair<int,pii>
#define pb push_back
#define endl "\n"
template<typename T> tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update> order_set;
typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> order_trie;
typedef long long ll;
class DisjointSet{ public:
    vector<int> parent;
    DisjointSet(int n): parent(n) { for(int i=0; i<n; i++) parent[i] = i; }
    void join(int a, int b) { parent[find(b)] = find(a); }
    int find(int a){ return a == parent[a] ? a : parent[a] = find(parent[a]); }
    bool check(int a, int b){ return find(a) == find(b); }
};

//---------END-------//
template<typename T>
    void read(T &X){
        X=0;
        char c;
        int sign=1;
        c=getchar();
        if (c=='-') sign=-1;else X=X*10+c-'0';
        while ((c=getchar()) && ('0'<=c) && (c<='9'))
            X=X*10+c-'0';
    }
ll N,x,M,H,T;
vector<ll> A;
int main(){
    //ofile;
    cin >> N;
    for (ll i=1;i*i<=N;i++) if (N%i==0){
        A.pb(i);
        if (N/i!=i) A.pb(N/i);
    }
    sort(A.begin(),A.end());
    for (ll i:A) cout << i << endl;

}


#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define si(v) int(v.size())
#define len(v) int(v.length())
#define lob(v,n) lower_bound(all(v),n)
#define lobi(v,n) lower_bound(all(v),n) - v.begin()
#define upb(v,n) upper_bound(all(v),n)
#define upbi(v,n) upper_bound(all(v),n) - v.begin()
#define mod 1000000007
#define infi 1010000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;
template<typename T> bool chmax(T &a, T b) {if(a < b) {a = b;return 1;}return 0;}
template<typename T> bool chmin(T &a, T b) {if(a > b) {a = b;return 1;}return 0;}

int main(){

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

    int H,W;
    cin >> H >> W;
    int x,y;
    cin >> x >> y;

    ve<string> s(H);
    in(H,s);

    x--,y--;
    int ans = 0;
    for (int i = x+1; i < H; i++) {
        if(s[i][y] == '.')ans++;
        else break;
    }
    for (int i = x-1; i >= 0; i--) {
        if(s[i][y] == '.')ans++;
        else break;
    }
    for (int i = y+1; i < W; i++) {
        if(s[x][i] == '.')ans++;
        else break;
    }
    for (int i = y-1; i >= 0; i--) {
        if(s[x][i] == '.')ans++;
        else break;
    }

    cout << ans+1 << endl;

    return 0;
}


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

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

const int MOD     = 1e9+7;
const int INF     = 0x3f3f3f3f;
const ll  LLINF   = 0x3f3f3f3f3f3f3f3f;
const int MAXN    = 200005;
const int MAXM    = 1000005;

int b[MAXN];
struct Node {
    long double x;
    int id;
    Node(){}
    Node(long double x, int id):x(x), id(id){}
    bool operator < (const Node &B) const {
        return x > B.x;
    }
}a[MAXN];
priority_queue<pair<double, ll> > Q;
int main(){

    int K;
    int N, M;
    cin >> K >> N >> M;
    int S = M;
    for(int i = 0; i < K; i++) {
        int x;
        cin >> x;
        long double t = (long double)M*(long double)x/(long double)N;
        b[i] = t;
        S -= b[i];
        a[i].x = t - (long double)b[i];
        a[i].id = i;
    }
    sort(a, a + K);
    for(int i = 0; i< S; i++) {
        b[a[i].id]++;
    }
    for(int i = 0; i< K; i++) cout << b[i] << " ";
    cout << endl;

    return 0;
}

#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
    #include <atcoder/all>
    using namespace atcoder;
#endif
using namespace std;

//#define int long long
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef vector<vector<int>> graph;
#define pu push
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define MOD 1000000007
#define MAXX 1.1529215e+18
#define _1 first
#define _2 second
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
#define si(x) int(x.size())

template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}

template<class t> using vc=vector<t>;

template<class T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

template<class T>
T extgcd(T a, T b, T &x, T &y) {
    T d = a;
    if (b == 0) {
      x = 1;
      y = 0;
    } else {
      d = extgcd(b, a%b, y, x);
      y -= (a/b)*x;
    }
    return d;
}

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p._1<<","<<p._2<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}

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

  int K;
  ll N, M;
  cin >> K >> N >> M;
  vector<ll> A(K);
  rep(i, K) {
    cin >> A[i];
  }
  ll l = 0;
  ll r = 2e9;
  while(r-l>1) {
      ll m = (l+r)/2;
      bool flag = true;
      ll sum1 = 0;
      ll sum2 = 0;
      rep(i, K) {
        ll t1 = (M*A[i]+m)/N;
        ll t2 = (M*A[i]-m+N-1)/N;
        sum1 += t1;
        sum2 += t2;
        if (t2 > t1) {
          flag = false;
        }
      }
      if (!(sum1 >= M && sum2 <= M))
        flag = false;
      if (flag) {
          r = m;
      } else {
          l = m;
      }
      // cout << m << endl;
  }
  // cout << r << ' ' << l << endl;
  vector<ll> v1(K);
  vector<ll> v2(K);
  int cnt = 0;
  rep(i, K) {
    v1[i] = (M*A[i]-r+N-1)/N;
    v2[i] = (M*A[i]+r)/N-(M*A[i]-r+N-1)/N;
    cnt += v1[i];
  }
  // cout << v1 << endl;
  // cout << v2 << endl;
  ll res = M-cnt;
  rep(i, K) {
    if (res < v2[i]) {
      v1[i] += res;
      res = 0;
    } else {
      v1[i]+= v2[i];
      res -= v2[i];
    }
  }
  // if (res > 0) {
  //   rep(i, K) {
  //     if (i < res % K) {
  //       v1[i] += res/K+1;
  //     } else {
  //       v1[i] += res/K;
  //     }
  //   }
  // }
  rep(i, K) {
    cout << v1[i] << ' ';
  }
  cout << endl;
}


#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define mp make_pair
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define w(x) int x;cin>>x;while(x--)
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define vvi vector<vector<int>>
#define precision(x,k) fixed<<setprecision(k)<<x
#define inf 1e16
int eps = 1e-9;
int arr[300005];

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	//cout << "YES" << endl;
	double k, n, m;
	cin >> k >> n >> m;
	double x = m / n;
    //cout<<x<<endl;
	vector<int>ans;
	vector<pair<double, int>>temp;
	for0(i, k)
	{
		cin >> arr[i];
	}
	int sum = 0;
	for0(i, k)
	{
		double cc = x * arr[i];
		int jj = cc;
		double rem = cc - jj;
       // cout<<jj<<" "<<cc<<" "<<arr[i]<<endl;
		ans.push_back(jj);
		sum += jj;
		temp.push_back({rem, i});
	}
	sort(temp.begin(), temp.end());
	int remaning = m - sum;
    //cout<<remaning<<endl;
	int kkk = 0;
	for(int i=k-1;i>=0;i--)
	{
        if (kkk == remaning)
			break;
		pair<int, int>pp = temp[i];
      //  cout<<pp.second<<endl;
		ans[pp.second]++;
		kkk++;

	}
	for0(i, k)
	cout << ans[i] << " ";
	cout << endl;

	return 0;
}

#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<tuple>
#include<cstring>
#include<bitset>

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define pb push_back
#define eb emplace_back

#define INF 1000000000
#define INFLL 1000000000000000000LL

using namespace std;

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

using ll = long long;
using PP = pair<ll, ll>;

#define MAX_N 200000+100

ll N, K, now, ans;
PP X[MAX_N];

int main() {

	cin >> N >> K;

	REP(i, N)cin >> X[i].first >> X[i].second;
	X[N].first = INFLL * 2;

	sort(X, X + N + 1);

	REP(i, N+1) {
		if (X[i].first <= now + K) {
			K -= X[i].first - now;
			K += X[i].second;
			now = X[i].first;
		}
		else {
			break;
		}
	}

	cout << now + K << endl;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define mems(p) memset(p,-1,sizeof(p))
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define nl "\n"

const int mxN = 1e5;
const ll MOD = 1e9 + 7;

void fast()
{ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

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

vector<ll> factorial;

ll expo(ll x, ll exp) {
    if (exp <= 0) return 1;
    ll tmp = (x*x)% MOD;
    if (exp%2) {
        return (expo(tmp, exp/2) * x) % MOD;
    }
    return (expo(tmp, exp/2)) % MOD;
}

ll choice(ll n, ll r) {
	if (n < r) return 0;
    ll numer = factorial[n];
    ll denom = (factorial[r] * factorial[n-r]) % MOD;
    return numer * expo(denom, MOD - 2) % MOD;
}

int main() {
	fast();
	ll n;
	cin>>n;
	ll ans = 0;
	vector<ll> fromdown, fromup;
	for (ll i = 1; i * i <= n; ++i)
	{
		if (n%i == 0) {
			fromdown.pb(i);
			if (n/i != i) fromup.pb(n/i);
		}
	}
	for (ll x : fromdown) {
		cout<<x<<nl;
	}
	for (int i = (int)fromup.size() - 1; i >= 0; --i) {
		cout<<fromup[i]<<nl;
	}

}

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; typedef long double ld; typedef vector <int> vi; typedef vector <ll> vll; typedef vector <string> vS; typedef vector <vector <int>> vv; typedef map<int, int> mi; typedef map<string, int> ms; typedef map<char, int> mc; typedef string S; typedef map <ll, ll> ml; typedef map <int, bool> mb; typedef vector <ld> vld; typedef vector <bool> vb; typedef map<ll, ll> mll;
#define FOR(i,N) for(int i = 0 ; i < N;i++)
#define eFOR(i,a,b) for(int i = a; i <=b;i++)
#define dFOR(i,N) for(int i = N - 1; i>=0;i--)
#define edFOR(i,a,b) for(int i = b ; i >=a;i--)
#define all(x) x.begin(),x.end()
#define SORT(x) sort(all(x))
#define RSORT(x) sort(x.rbegin(),x.rend())
#define mine(x) min_element(all(x))
#define maxe(x) max_element(all(x))
#define pb push_back
#define PI 3.14159265359
const int mod = 1e9 + 7;
int CASE = 1;
bool prime(ll n)
{
	if (n <= 1)
		return false;
	for (int i = 2; i <= sqrt(n); i++)
		if (!(n % i))
			return false;
	return true;
}
void solve()
{
	ll n;
	cin >> n;
	if (n == 1)
	{
		cout << 1;
		return;
	}
	if (prime(n))
	{
		cout << 1 << endl << n;
		return;
	}
	vll ans = { 1 , n };
	bool check = false;
	if (int(sqrt(n)) * sqrt(n) == n)
		ans.pb(sqrt(n)), check = true;;
	eFOR(i, 2, sqrt(n - check))
	{
		if (n % i == 0)
			ans.pb(i), ans.pb(n / i);
	}
	SORT(ans);
	FOR(i, ans.size())
		cout << ans[i] << endl;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int T = 1;
	while (T--)
	{
		solve();
	}
}


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

typedef pair<int,int> pii;
typedef pair<string,int> psi;
typedef pair<int,string> pis;
typedef array<int,2> aii;
typedef array<int,3> aiii;
typedef array<int,4> aiiii;
typedef unsigned long long ull;
typedef long long int ll;
typedef array<ll,2> all;
typedef array<ll,3> alll;

#define pb push_back
#define ff first
#define ss second
#define MAX 1000005
#define MOD 1000000007
#define INF 1e9+100
vector<int>adj[MAX];
int xMove[] = { 0,1,0,-1,1,1,-1,-1, 2, 2, -2, -2, 1, 1, -1, -1 };
int yMove[] = { 1,0,-1,0,1,-1,1,-1, 1, -1, 1, -1, 2, -2, 2, -2 };
string arr[65];
ll dp[65][2],n;
ll solve(int i, int p)
{
    if(i==n)
        return p==1;
    if(dp[i][p]!=-1)
        return dp[i][p];
    ll ans=0;
    ans+=solve(i+1,arr[i]=="AND"?p&1:p|1);
    ans+=solve(i+1,arr[i]=="AND"?p&0:p|0);
    return dp[i][p]=ans;
}
int main()
{
    //freopen("joseph.in","r",stdin);
    //freopen("output.txt","w",stdout);
    cin.tie(0),cout.tie(0);
    ios_base::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(10);
    int TC=1;
    int m,k,q;

    //cin>>TC;
    for(int t1=1; t1<=TC; t1++)
    {
        cin>>n;
        for(int i=0; i<n; i++)
            cin>>arr[i];
        memset(dp,-1,sizeof dp);
        cout<<solve(0,1)+solve(0,0)<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vec;
using Graph = vector<vector<int>>;
const long long INF = 1LL<<60;
const int MOD = 1000000007;

struct SegmentTree {
private:
    int n;
    vector<int> node;

public:
    // 元配列 v をセグメント木で表現する
    SegmentTree(vector<int> v) {
        // 最下段のノード数は元配列のサイズ以上になる最小の 2 冪 -> これを n とおく
        // セグメント木全体で必要なノード数は 2n-1 個である
        int sz = v.size();
        n = 1; while (n < sz) n *= 2;
        node.resize(2 * n - 1, -MOD);

        // 最下段に値を入れたあとに、下の段から順番に値を入れる
        // 値を入れるには、自分の子の 2 値を参照すれば良い
        for (int i = 0; i < sz; i++) node[i + n - 1] = v[i];
        for (int i = n - 2; i >= 0; i--) node[i] = max(node[2 * i + 1], node[2 * i + 2]);
    }

    void update(int x, int val) {
        // 最下段のノードにアクセスする
        x += (n - 1);

        // 最下段のノードを更新したら、あとは親に上って更新していく
        node[x] = val;
        while (x > 0) {
            x = (x - 1) / 2;
            node[x] = max(node[2 * x + 1], node[2 * x + 2]);
        }
    }

    // 要求区間 [a, b) 中の要素の最小値を答える
// k := 自分がいるノードのインデックス
// 対象区間は [l, r) にあたる

    int getmin(int a, int b, int k = 0, int l = 0, int r = -1) {
        // 最初に呼び出されたときの対象区間は [0, n)
        if (r < 0) r = n;

        // 要求区間と対象区間が交わらない -> 適当に返す
        if (r <= a || b <= l) return -MOD;

        // 要求区間が対象区間を完全に被覆 -> 対象区間を答えの計算に使う
        if (a <= l && r <= b) return node[k];

        // 要求区間が対象区間の一部を被覆 -> 子について探索を行う
        // 左側の子を vl ・ 右側の子を vr としている
        // 新しい対象区間は、現在の対象区間を半分に割ったもの
        int vl = getmin(a, b, 2 * k + 1, l, (l + r) / 2);
        int vr = getmin(a, b, 2 * k + 2, (l + r) / 2, r);
        return max(vl, vr);
    }
};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;cin>>n;
    vec a(n);
    rep(i,n){
        string s;
        cin>>s;
        if(s=="AND")a[i]=0;
        else a[i]=1;
    }
    vector<vector<ll>> dp(n+1,vector<ll>(2));
    dp[0][0]=1;dp[0][1]=1;
    rep(i,n){
        if(a[i]==0){
            dp[i+1][1]=dp[i][1];
            dp[i+1][0]=dp[i][1]+2*dp[i][0];
        }
        else{
            dp[i+1][1]=dp[i][0]+dp[i][1]*2;
            dp[i+1][0]=dp[i][0];
        }
    }
    cout<<dp[n][1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long a[2000005],s[2000005],mmax[2000005];
int main()
{
    int n;
    cin>>n;
   long long sum=0;
    for (int i=1;i<=n;i++){
        cin>>a[i];
        sum-=1ll*(i-1)*mmax[i-1];
        mmax[i]=max(mmax[i-1],a[i]);
        s[i]=s[i-1]+a[i];
        sum+=i*mmax[i];
        sum+=s[i];
        cout<<sum<<endl;
    }
    return 0;
}

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

#define rep(i,_l,_r) for(signed i=(_l),_end=(_r);i<=_end;++i)
#define fep(i,_l,_r) for(signed i=(_l),_end=(_r);i>=_end;--i)
#define erep(i,u) for(signed i=head[u],v=to[i];i;i=nxt[i],v=to[i])
#define efep(i,u) for(signed i=Head[u],v=to[i];i;i=nxt[i],v=to[i])
#define print(x,y) write(x),putchar(y)
//#define debug(...) do {cerr<<__LINE__<<" : ("#__VA_ARGS__<<") = "; Out(__VA_ARGS__); cerr<<flush;} while(0)
//template <typename T> void Out(T x) {cerr<<x<<"\n";}
//template <typename T,typename ...I> void Out(T x,I ...NEXT) {cerr<<x<<", "; Out(NEXT...);}

template <class T> inline T read(const T sample) {
    T x=0; int f=1; char s;
    while((s=getchar())>'9'||s<'0') if(s=='-') f=-1;
    while(s>='0'&&s<='9') x=(x<<1)+(x<<3)+(s^48),s=getchar();
    return x*f;
}
template <class T> inline void write(const T x) {
    if(x<0) return (void) (putchar('-'),write(-x));
    if(x>9) write(x/10);
    putchar(x%10^48);
}
template <class T> inline T Max(const T x,const T y) {if(x>y) return x; return y;}
template <class T> inline T Min(const T x,const T y) {if(x<y) return x; return y;}
template <class T> inline T fab(const T x) {return x>0?x:-x;}
template <class T> inline T gcd(const T x,const T y) {return y?gcd(y,x%y):x;}
template <class T> inline T lcm(const T x,const T y) {return x/gcd(x,y)*y;}
template <class T> inline T Swap(T &x,T &y) {x^=y^=x^=y;}

typedef long long ll;

const int maxn=2e5+5;

int n,a[maxn];
ll mx,sum,ans;

int main() {
	n=read(9);
	rep(i,1,n) a[i]=read(9);
	rep(i,1,n) {
		sum+=a[i],ans+=sum;
		mx=Max(mx,0ll+a[i]);
		print(1ll*mx*i+ans,'\n');
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
//#define per(i,a,n) for (int i=n-1;i>=a;i--)
// #define repl(i,a,n) for(long long int i=a;i<n;i++)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef vector<int> VI;
typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
ll MOD=9;
ll mod=9;
//const llint MOD;
const ll N=(ll)(1e6+1);
const ll mx=1e7;
const int inf=10000;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll add(ll a,ll b){return ((a%MOD)+(b%MOD))%MOD;}
ll mul(ll a,ll b){return ((a%MOD)*(b%MOD))%MOD;}
ll sub(ll a,ll b){return ((a%MOD)-(b%MOD)+MOD)%MOD;}
ll binpow(ll x, ll y){ll z = 1;while(y){if(y & 1) z = mul(z, x);x = mul(x, x);y >>= 1;}return z;}
ll inv(int x){return binpow(x, MOD - 2);}
ll divide(ll x, ll y){return mul(x, inv(y));}
ll fact[N];
void precalc(){fact[0] = 1;for(ll i = 1; i < N; i++)fact[i] = mul(fact[i - 1], i);}
ll C(ll n, ll k){return divide(fact[n], mul(fact[k], fact[n - k]));}
bool prime[mx];
void sieve() {for(int i=2;i<mx;i++) {prime[i]=true;}for (int p=2; p*p<=N; p++){if (prime[p] == true){for (int i=p*p; i<=N; i += p)prime[i] = false;}}}
vector<ll> primes;
void primecalc(){for(int i=2;i<=mx;i++){
		if(prime[i])
	{
		primes.pb(i);
	}
	if (primes.size()==(int)5e5){break;}
}}
ll legendpow(ll n, ll p){ll total = 0;while (n){n /= p;total += n;}return total;}
ll phi(ll n) {
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n /= i;
            result -= result / i;
        }
    }
    if (n > 1)
        result -= result / n;
    return result;
}
 vector <pair<ll,ll>> prifac;
 void primefac(ll n){int state=0;while (n % 2 == 0){n = n/2;state++;} if (state) prifac.pb({2,state});for (ll i = 3; i <= sqrt(n); i = i + 2) { state=0;while (n % i == 0){state++;n = n/i;}  if (state) prifac.pb({i,state});}  if (n > 2)  prifac.pb({n,1});}

//head==================================================================================
// in greedy if comparison see weight or diff

int main(){

 ll a,b,c;
 cin>>a>>b>>c;
primefac(a);
ll ans=1;
ll h=phi(10);
mod=h;
MOD=h;
ll op=powmod(b,c);
for ( auto x : prifac)
{
    if (x.first==2){
    	ll k=5;
    	ll io=phi(k);
    	ll nn=1;
    	mod=io;
    	MOD=io;
    	ll exp=powmod(b,c);
    	exp=mul(exp,x.second);
    	exp=exp+io-1;
    	 mod=phi(10);
    mod=10;
    MOD=10;
    ll tu=powmod(x.first,exp);
    tu=mul(tu,2);
    ans=mul(ans,tu);
    }
   else  if (x.first==5){
    	ll k=2;
    	ll io=phi(k);
    	ll nn=1;
    	mod=io;
    	MOD=io;
    	ll exp=powmod(b,c);
    	exp=mul(exp,x.second);
    	exp=exp+io-1;
    	 mod=phi(10);
    mod=10;
    MOD=10;
    ll tu=powmod(x.first,exp);
    tu=mul(tu,5);
    ans=mul(ans,tu);
    }
    else
    {

    mod=phi(10);
    MOD=phi(10);
	ll tu=mul(x.second,op);
    mod=10;
    MOD=10;
    tu=powmod(x.first,tu);
    ans=mul(ans,tu);
} }
cout<<ans;
 }

//g++ t.cpp -o t && t < p.txt
//d>p.txt&&t<p.txt&&t2<p.txt

#include <iostream> //
#include <vector> //
#include <algorithm> //
#include <queue> //
#include <string> //
#include <functional> //
#include <set> //
#include <unordered_map> //
#include <random> //
#include <ctime> //
#include <bitset> //
#include <cassert>

// #include <atcoder/all>
// using namespace atcoder;
// g++ t.cpp -o t -I .

#define DB cerr<<"D"<<endl

struct _zo{_zo(){std::cin.tie(nullptr);std::cout.tie(nullptr);std::ios::sync_with_stdio(false);}}__zo;
using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18; const double dINF = 1e18; const ld ldINF = 1e18; const double EPS = 1e-6;
using P=pair<ll,ll>;
using Q=pair<pair<ll,ll>,ll>;
const ll M = 998244353;
ll mod_pow(ll x, ll a) { ll an = 1; while(a > 0) { if (a&1) an = an * x % M; x = x * x % M; a >>= 1;} return an;}
ll mod_pow(ll x, ll a, ll m) { ll an = 1; while(a > 0) { if (a&1) an = an * x % m; x = x * x % m; a >>= 1;} return an;}
void add(ll& x, ll y) {x+=y; x%=M;}; void mul(ll& x, ll y) {x*=y; x%=M;}; template<typename T, typename U> void chmax(T& x, U y) {if (x<y) x=y;}; template<typename T, typename U> void chmin(T& x, U y) {if (x>y) x=y;} bool vaild(int x, int y, int hh, int ww){return 0<=x&&x<hh&&0<=y&&y<ww;}
ll gcd(ll a, ll b) {if (b==0) return a; else return gcd(b, a%b);}
int keta(ll a) {int res=0; while(a>0) res+=a%10, a/=10; return res;}
const int up[]={1,-1,0,0}, lf[]={0,0,1,-1};

int main() {
  ll a,b,c;cin>>a>>b>>c;
  a %= 10;
  vector<ll> p[10];
  p[0] = vector<ll>({0});
  p[1] = vector<ll>({1});
  p[2] = vector<ll>({2,4,8,6});
  p[3] = vector<ll>({3,9,7,1});//3,9,27,81
  p[4] = vector<ll>({4,6});//4,16,64
  p[5] = vector<ll>({5});//5,25
  p[6] = vector<ll>({6});//6,36
  p[7] = vector<ll>({7,9,3,1});//7,49,3,1,7
  p[8] = vector<ll>({8,4,2,6});//8,64,512,6,8
  p[9] = vector<ll>({9,1});//9,81,729,

  /*
  if (p[a].size() == 1) {
    cout<<a<<endl;
  } else if (p[a].size() == 2) {
    if (b%2==0) cout<<p[a][1]<<endl;
    else cout<<a<<endl;
  } else {
    // b^c mod 4 = ?
  }*/
  ll dv = p[a].size();
  ll id = mod_pow(b%dv,c,dv);
  //cout<<dv<<" "<<id<<endl;
  id=(id-1+dv)%dv;
  cout<<p[a][id]<<endl;
}
//

// ・配列の大きさok？　・priority_queueはgreater？　・debug消した？
// ・落ち着いて。提出まで4分待ってね……WJ……1/10……2/10……

// Thank you for making problems and running the contest


#include <bits/stdc++.h>
#define INF 1000000007
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i < b; i++)

using namespace std;

typedef long long ll;
typedef long long int  lli;
typedef long double ld;
typedef vector<int> vi;
typedef unordered_map<int,int> umi ;
typedef unordered_set<int> usi ;
typedef pair<int,int> pi;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

//declare here -------------------------------------------------------------------------------
const int N =1e5+5 ;
bool ing(ld val){
	return ceil(val)==floor(val) ;

}
// solve here ---------------------------------------------------------------------------------

void solve(){
	 ld s,p ;
	 cin>>s>>p ;
	 ld D = s*s - (4*p) ;
	 ld b= -s ;
	 ld a= 1 ;
	 if( D <0 ){
	 	cout<<"No" ;
	 }

	 else{
	 	ld val= sqrt(D) ;
	 	debug(D,val) ;
	 	ld x = (-b + val) /(2*a) ;
	 	ld y=  (-b -val) /(2*a) ;
	 	debug(x,y) ;
	 	if(ing(x) && ing(y) && x>0 && y>0) cout<<"Yes" ;
	 	else cout<<"No" ;
	 }

}

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

int main(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long test =1 ;
   	//cin>>test ;
    while(test--){
        solve() ;
        cout<<"\n" ;
    }
    return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
     long long int i,s,p,j;
     cin>>s>>p;
     for(i=1;;i++){
               if(i*(s-i)==p){
                    cout<<"Yes\n";
                    return 0;
               }
       if(i*(s-i)>p){break;}
          }
     cout<<"No\n";
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 10;
int n, m;
int t[N];
void add(int x, int v) {
  for(int i = x; i <= n; i += i & (-i)) t[i] ^= v;
}
int cal(int x) {
  int res = 0;
  for(int i = x; i > 0; i -= i & (-i)) res ^= t[i];
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  int opt, x, y;
  for(int i = 1; i <= n; i++) {
    scanf("%d", &x);
    add(i, x);
  }
  for(int i = 1; i <= m; i++) {
    scanf("%d%d%d", &opt, &x, &y);
    if(opt == 1) add(x, y);
    else printf("%d\n", cal(y) ^ cal(x - 1));
  }
  return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<unordered_set>
#include<unordered_map>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rrep(i,l,r) for(int i=l;i<=r;i++)
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define all(x) x.begin(),x.end()
#define unq(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define mod 1000000007
//#define mod 998244353
#define ad(a,b) a=(a+b)%mod;
#define mul(a,b) a=a*b%mod;
void readv(vector<ll> &a,ll n){
	rep(i,n){
		ll x;
		cin>>x;
		a.push_back(x);
	}
}
void outv(vector<ll> &a,ll n){
	rep(i,n){
		if(i>0)cout<<" ";
		cout<<a[i];
	}
	cout<<"\n";
}
ll po(ll x,ll y){
	ll res=1;
	for(;y;y>>=1){
		if(y&1)res=res*x%mod;
		x=x*x%mod;
	}
	return res;
}
ll gcd(ll a,ll b){
	return (b?gcd(b,a%b):a);
}
#define FACMAX 200010
ll fac[FACMAX],inv[FACMAX],ivf[FACMAX];
void initfac(){
	fac[0]=ivf[0]=inv[1]=1;
	for(ll i=1;i<FACMAX;i++)fac[i]=fac[i-1]*i%mod;
	for(ll i=1;i<FACMAX;i++){
		if(i>1)inv[i]=(mod-mod/i*inv[mod%i]%mod)%mod;
		ivf[i]=po(fac[i],mod-2);
	}
}
ll P(ll n,ll k){
	if(n<0||n<k)return 0;
	return fac[n]*ivf[n-k]%mod;
}
ll C(ll n,ll k){
	if(k<0||n<k)return 0;
	return fac[n]*ivf[n-k]%mod*ivf[k]%mod;
}
ll H(ll n,ll k){
	return C(n+k-1,k);
}
ll n,m,a[10010],b[10010],c[110];
vector<ll> eid[110];
ll ans[10010];
bool ans_ok[10010];
vector<ll> g[110];
ll p[110],d[110];
bool vis[110];
void dfs(ll x,ll from,ll dep){
	if(vis[x])return;
	vis[x]=1;
	d[x]=dep;
	p[x]=from;
	for(auto y:g[x])if(y!=from){
		dfs(y,x,dep+1);
	}
}
vector<ll> to[110];
ll dfs2(ll x){
	if(vis[x])return 0;
	ll res=1;
	vis[x]=1;
	for(auto y:to[x])res+=dfs2(y);
	return res;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cin>>n>>m;
	rep(i,m){
		cin>>a[i]>>b[i];
		a[i]--,b[i]--;
	}
	rep(i,n)cin>>c[i];
	rep(i,m){
		if(c[a[i]]==c[b[i]]){
			eid[c[a[i]]].pb(i);
		}
		else{
			if(c[a[i]]>c[b[i]])ans[i]=0;
			else ans[i]=1;
		}
		ans_ok[i]=0;
	}
	for(int l=1;l<=n;l++){
		rep(i,n)g[i].clear();
		for(auto i:eid[l]){
			g[a[i]].pb(b[i]);
			g[b[i]].pb(a[i]);
		}
		for(int s=0;s<n;s++){
			rep(i,n)vis[i]=0,p[i]=-1,d[i]=-1;
			dfs(s,-1,0);
			vector<ll> comp;
			rep(i,n)if(vis[i])comp.pb(i);
			vector<ll> es;
			for(auto i:eid[l]){
				if(vis[a[i]]==1&&vis[b[i]]==1)es.pb(i);
			}
			rep(i,n)to[i].clear();
			for(auto i:es){
				if(ans_ok[i])continue;
				if(p[a[i]]==b[i]){
					to[b[i]].pb(a[i]);
					ans[i]=1;
				}
				else if(p[b[i]]==a[i]){
					to[a[i]].pb(b[i]);
					ans[i]=0;
				}
				else if(d[a[i]]<d[b[i]]){
					to[b[i]].pb(a[i]);
					ans[i]=1;
				}
				else{
					to[a[i]].pb(b[i]);
					ans[i]=0;
				}
			}
			bool renketsu=1;
			for(auto t:comp){
				for(auto i:comp)vis[i]=0;
				renketsu&=(dfs2(t)==(ll)comp.size());
			}
			if(renketsu){
				for(auto i:es)ans_ok[i]=1;
			}
		}
	}
	rep(i,m){
		cout<<(ans[i]==0?"->":"<-")<<"\n";
	}
}


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

using namespace std;

template<class T>
istream& operator >>(istream& is, vector<T>& v){
	for(auto&& elem:v)cin >> elem;
	return is;
}

template<class T>
ostream& operator <<(ostream& os, const vector<T>& v){
	for(auto&& elem: v)os << elem << ", ";
	return os;
}

int main(){
	int n;
	cin >> n;
	vector<long long>x(n);
	cin >> x;

	long long m = 0;
	long long e = 0.0;
	long long max = 0;

	for(auto&& elem:x){
		m += abs(elem);
		e += abs(elem)* abs(elem);
		if(abs(elem) > max) max = abs(elem);
	}

	cout<< m << endl;
	cout<< fixed << setprecision(15) << sqrt(static_cast<double>(e)) <<endl;
	cout<< max << endl;
	fflush(stdout);

	return 0;
}

/**         (buri nazar wale tera muh kala 😑)
 *
 * @Author   : rudraksh
 * @Created  : Saturday, January 16th 2021, 6:13:01 pm
 * @Email    : rudrakshk@iitbhilai.ac.in
 *
 *   “My code works? - don't ask me how”
 */

#include <bits/stdc++.h>
#include <unistd.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef double db;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef map<int,int> MI;
typedef map<ll,ll> ML;

#define ar              array
#define pb              push_back
#define pf              push_front
#define popb            pop_back
#define popf            pop_front
#define eb              emplace_back
#define F               first
#define S               second
#define repa(i,a,n)     for(ll i=a;i<n;i++)
#define rep(i,n)        for(ll i=0;i<n;i++)
#define pera(i,a,n)     for(ll i=a;i>=n;i--)
#define per(i,n)        for(ll i=n;i>=0;i--)
#define all(x)          (x).begin(),(x).end()
#define loop(it,x)      for(auto it=x.begin();it!=x.end();it++)
#define MS0(x)          memset((x), 0, sizeof((x)))
#define MS1(x)          memset((x), -1, sizeof((x)))
#define CP(dst,src)     memcpy(dst, src, sizeof(src))
#define SZ(x)           ((ll)(x).size())
#define watch(x)        cout << (#x) << " is " << (x) << endl
#define TIME            cerr << "\nTime elapsed: " << setprecision(5) << 1000.0*clock()/CLOCKS_PER_SEC << "ms\n";

const ll mod = 1e9+7;
const double pi = acos(-1);

template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;

// oset.insert({x, id++}); for multiset. Better than less_equal<T>,erase won't work & lb work as ub and vice versa
template<typename T, typename Comp = less<T> >
using oset = tree<T, null_type, Comp, rb_tree_tag, tree_order_statistics_node_update>;

//find_by_order(k)  --> value at kth index (iterator)
//order_of_key(k)   --> no of elements strictly less than k (0 based index)
template<typename T, typename T1, typename Comp = less<T> >
using omap = tree<T, T1, Comp, rb_tree_tag, tree_order_statistics_node_update>;

template<typename T>ostream& operator<<(ostream& out,vector<T>& v){for(auto& x: v)out<<x<<' '; return out;}
template<typename T>istream& operator>>(istream& in,vector<T>& v){for(auto& x: v)cin>>x; return in;}

template<typename T,typename T1>bool amax(T &a,T1 b){if(b>a){a=b; return 1;} return 0;}
template<typename T,typename T1>bool amin(T &a,T1 b){if(b<a){a=b; return 1;} return 0;}

void print() { cout<<'\n'; }
// void print() { cout<<endl; }

template <typename T, typename... Params>
void print(T var1, Params... var2) {cout<<var1<<' '; print(var2...);}

ll ceil_div(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b != 0); }

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

/************* I don't know what i'm doing ****************/

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

    int n, box;
    cin >> n >> box;
    MI m;
    rep(i, n)
    {
        int x;
        cin >> x;
        m[x]++;
    }
    int maxi = box;
    int ans = 0;
    rep(num, n)
    {
        amin(maxi, m[num]);
        ans += maxi;
        // print(num, maxi);
        if(maxi == 0) break;
    }
    print(ans);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(size_t i=(l); i<(r); i++)
#define REP(i,n) FOR(i,0,n)
#define endl "\n"
#define debug(x) cout<<x<<endl;
typedef long long ll;
static const ll INF = 1ll<<60;
static const double EPS = 10e-12;

int main(){
    int N;
    ll X;
    cin>>N>>X;
    vector<ll> V(N),P(N);
    REP(i,N) cin>>V[i]>>P[i];
    ll sum = 0;
    int ans = -1;

    X *= 100;

    REP(i,N){
        sum += V[i] * P[i];
        if(sum > X){
            ans = i+1;
            break;
        }
    }

    cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
#define Rep(i,x,n) for(i=x;i<=n;i++)
#define foreach(c,itr) for(__typeof(c)::iterator itr=c.begin();itr!=c.end();itr++)
#define all(v) v.begin(),v.end()
#define p_b push_back
#define fr first
#define sc second
#define m_p make_pair
#define setp setprecision
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f;
ll gcd(ll x,ll y) {return x%y==0 ? y:gcd(y,x%y);}
int i,j;

int n,x;
int v[1005],p[1005];
double ach[1005];

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

	double num=0;
	Rep(i,1,n){
		num+=ach[i];
		if(num>x){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}

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

	int num=0;
	Rep(i,1,n){
		num+=ach[i];
		if(num>x){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
	return 0;
}

int main(){
	cin>>n>>x;
	Rep(i,1,n){
		cin>>v[i]>>p[i];
		ach[i]=v[i]/100.0*p[i];
	}
	if(n<=3) main1();
	else main2();
}


#include<bits/stdc++.h>
using namespace std;
using namespace std::chrono;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
#define FOR(i, a, b) for(ll i=(a); i < (ll)(b); ++i)
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;}

enum Walk{
	L,R,U,D
};
struct Coord{
	int x,y;
	void move(Walk walk){
		switch(walk){
			case L: y--;
			break;
			case R: y++;
			break;
			case U: x--;
			break;
			case D: x++;
			break;
		}
	}
	void back(Walk walk){
		switch(walk){
			case L: y++;
			break;
			case R: y--;
			break;
			case U: x++;
			break;
			case D: x--;
			break;
		}
	}
};
Coord taka;
struct Grid{
	int val[50][50];

	int get(Coord coord){
		return val[coord.x][coord.y];
	}
};
Grid t,p;
vector<bool> visited;
string ans = "";
string lastans;
ll lastscore = 0;
ll numofSearch = 0;
const Walk wlist[4][3] = {
	{L, U, D},
	{R, D, U},
	{U, R, L},
	{D, L, R},
};

system_clock::time_point time_start = system_clock::now();
constexpr double TIME_END = 1950;
random_device seed_gen;
mt19937_64 engine(seed_gen());

void input(){
	scanf("%d %d",&(taka.x),&(taka.y));
	int tmax=0;
	REP(i,50) REP(j,50) {
		scanf("%d" ,&(t.val[i][j]));
		chmax(tmax, t.val[i][j]);
	}
	visited.resize(tmax+1, false);
	REP(i,50) REP(j,50) scanf("%d" ,&(p.val[i][j]));
}
void output(){
	//cerr << "score: " << lastscore << "\nnum: " << numofSearch << "\n";
	// cout << lastans << "\n";
	printf("%s\n",lastans.c_str());
}
void addtoAns(Walk walk){
	switch(walk){
		case L: ans += 'L';
		break;
		case R: ans += 'R';
		break;
		case U: ans += 'U';
		break;
		case D: ans += 'D';
		break;
	}
}
bool canWalk(Walk walk){
	if(walk == L){
		if(taka.y == 0) return false;
		else return !visited[t.val[taka.x][taka.y-1]];
	}
	if(walk == R){
		if(taka.y == 49) return false;
		else return !visited[t.val[taka.x][taka.y+1]];
	}
	if(walk == U){
		if(taka.x == 0) return false;
		else return !visited[t.val[taka.x-1][taka.y]];
	}
	if(walk == D){
		if(taka.x == 49) return false;
		else return !visited[t.val[taka.x+1][taka.y]];
	}
	return false;
}

bool dfs(Walk walk, ll score){
	if(!canWalk(walk)){
		if(score > lastscore){
			lastscore = score;
			lastans = ans;
		}
		return false;
	}

	if(numofSearch & (1<<20)){
		auto exe_time = duration_cast<milliseconds>(system_clock::now() - time_start).count();
		if((double)exe_time > TIME_END){
			if(score > lastscore){
				lastscore = score;
				lastans = ans;
			}
			return true;
		}
	}

	numofSearch++;
	taka.move(walk);
	visited[t.get(taka)] = true;
	score += p.get(taka);
	addtoAns(walk);

	if(walk==L){
		for(Walk x: wlist[0]) if(dfs(x, score)) return true;
	}else if(walk==R){
		for(Walk x: wlist[1]) if(dfs(x, score)) return true;
	}else if(walk==U){
		for(Walk x: wlist[2]) if(dfs(x, score)) return true;
	}else if(walk==D){
		for(Walk x: wlist[3]) if(dfs(x, score)) return true;
	}

	ans.pop_back();
	visited[t.get(taka)] = false;
	taka.back(walk);

	return false;
}

void solve(){
	visited[t.get(taka)] = true;

	if(dfs(L,0)) return;
	if(dfs(R,0))  return;
	if(dfs(U,0)) return;
	if(dfs(D,0)) return;
}

int main(){
	input();

	solve();

	output();
	return 0;
}

// I SELL YOU...!
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
#include<random>
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);
}
ll n=50;
ll dx[] = {1,0,-1,0};
ll dy[] = {0,1,0,-1};
vector<vector<ll>> t(n,vector<ll>(n));
vector<vector<ll>> p(n,vector<ll>(n));
void reset_d(const vector<ll> pt, vector<ll> &used) {
  for(auto p: pt) used[p] = false;
}
bool is_in(ll x,ll y){
  return x>=0&&y>=0&&x<n&&y<n;
}
random_device seed_gen;
mt19937 engine(seed_gen());
uniform_int_distribution<int> rand_dist(0, 14);
auto bden = bind(rand_dist, ref(engine));
ll eval(P x){
  return x.first * 300 + x.second;
}
TP prob_search(ll x,ll y,ll time,vector<ll> &used,ll cnt) {
  if (time != 0) {
    used[t[x][y]] = true;
    P now = P(-5,-5);
    ll sid = -1;
    used[t[x][y]] = true;
    for(int i=0;i<4;i++){
      ll nx = x + dx[i];
      ll ny = y + dy[i];
      if(!is_in(nx,ny)||used[t[nx][ny]]) {
        continue;
      }
      TP np = prob_search(nx,ny,time-1,used,cnt+1);
      P use = P(get<0>(np)+1,get<1>(np)+p[nx][ny]);
      if (eval(use) > eval(now)) {
        now = use;
        sid = i;
      }
    }
    used[t[x][y]] = false;
    return TP(now.first+1,now.second+p[x][y],sid);
  }
  ll sum = 0;
  vector<ll> use_t;
  ll c = 0;
  while(true){
    ll sid = -1,v=-1;
    used[t[x][y]] = true;
    use_t.push_back(t[x][y]);
    for(int j=0;j<4;j++){
      ll nx = x + dx[j];
      ll ny = y + dy[j];
      if(is_in(nx,ny)&&!used[t[nx][ny]]&&v<p[nx][ny]) {
        v = p[nx][ny];
        sid = j;
      }
    }
    if(sid==-1) {
      reset_d(use_t,used);
      return TP(c, sum,-1);
    }
    sum += v;
    x = x + dx[sid];
    y = y + dy[sid];
    c++;
  }
}
signed main(){
  const string st ="DRUL";
  init_io();
  ll sx,sy;
  cin >> sx >> sy;
  vector<char> mv;
  vector<ll> used(n*n,0);
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin >> t[i][j];
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin >> p[i][j];
    }
  }
  ll x = sx,y = sy;
  while(true){
    auto [sz, score, di] = prob_search(x,y,17,used,0);
    if(di==-1) break;
    used[t[x][y]] = true;
    mv.push_back(st[di]);
    x = x + dx[di];
    y = y + dy[di];
  }
  for(auto c:mv) cout << c;
  cout << endl;
}


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

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

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

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

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

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

ll modpow(ll a, ll exp, ll m){
    ll res = 1;
    while(exp>0){
        if(exp&1){
            res *= a;
            res %= m;
        }
        a = a*a;
        a %= m;
        exp >>= 1;
    }
    return res;
}

int main(){

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

    ll x = modpow(10, N, M*M);

    cout << x / M << endl;

    return 0;
}

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using Graph=vector<vector<int>>;

const double pi=3.141592653589793;
const int64_t inf=1L<<60;
const int64_t minf=-inf;
const int64_t mod=998244353; /*1000000007*/

int64_t N,M;

//pow
int64_t power(int64_t a,int64_t b){
  int64_t res=1;
  while(b>0){
    if(b&1){
      res=res*a%(M*M);
    }
    a=a*a%(M*M);
    b>>=1;
  }
  return res;
}

int main(){
  cin>>N>>M;
  int64_t k=power(10,N);
  cout<<k/M<<endl;
}


#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

template<long long Mod>
struct mint{
    long long x;
    mint(long long x=0) :x((x% Mod+Mod)%Mod){}

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

    mint& operator+=(const mint a) {
        if((x += a.x) >= Mod) x -= Mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if((x += Mod-a.x) >= Mod) x -= Mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= Mod;
        return *this;
    }

    mint operator^(long long t) const {
        mint ret(1);
        mint a = *this;
        while(t){
            if(t&1){
                ret *= a;
            }
            a *= a;
            t >>= 1;
        }
        return ret;
    }
    mint inv() const { return *this ^ (Mod-2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }

    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint operator/(const mint a) const { return mint(*this) /= a; }

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

int H, W, K;
string S[2000];

int g[2000][2000];

signed main(){
    cin >> H >> W;
    rep(i, H) cin >> S[i];

    rep(i, H){
        rep(j, W){
            if(S[i][j] == '.') K++;
        }
    }

    rep(i, H){
        int k;
        for(k=0; k<W; k++){
            if(S[i][k] == '#') break;
        }
        for(int l=0; l<k; l++){
            g[i][l] += k;
        }
        rep(j, W){
            if(S[i][j] == '#'){
                int k;
                for(k=j+1; k<W; k++){
                    if(S[i][k] == '#') break;
                }
                for(int l=j+1; l<k; l++){
                    g[i][l] += k-j-1;
                }
            }
        }
    }
    rep(j, W){
        int k;
        for(k=0; k<H; k++){
            if(S[k][j] == '#') break;
        }
        for(int l=0; l<k; l++){
            g[l][j] += k;
        }
        rep(i, H){
            if(S[i][j] == '#'){
                int k;
                for(k=i+1; k<H; k++){
                    if(S[k][j] == '#') break;
                }
                for(int l=i+1; l<k; l++){
                    g[l][j] += k-i-1;
                }
            }
        }
    }

    mint<MOD> ans = 0;
    rep(i, H){
        rep(j, W){
            if(S[i][j] == '#'){
                continue;
            }
            ans += mint<MOD>(2)^K;
            ans -= mint<MOD>(2)^(K-g[i][j]+1);
        }
    }
    cout << ans << endl;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    // Input from input.txt
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());

    // Speeding up cin
    cin.tie(0);
    ios::sync_with_stdio(false);

    // Main code
    int N, M;
    cin >> N >> M;
    vector<string> S(N);
    for (int i = 0; i < N; i++) {
        cin >> S[i];
    }

    int64_t even = 0, odd = 0;
    for (int i = 0; i < N; i++) {
        bitset<20> bs(S[i]);
        if (bs.count() % 2 == 0) {
            even++;
        } else {
            odd++;
        }
    }
    cout << even * odd << endl;

    return 0;
}


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

#define rep(i, l, r) for (int i = l; i <= r; ++i)
#define dep(i, r, l) for (int i = r; i >= l; --i)

const int mod = 1e9 + 7;

void read (int &x) {
	x = 0; char c = getchar();
	while(c < '0' || c > '9') c = getchar();
	while(c >= '0' && c <= '9')
		x = x * 10 + c - 48, c = getchar();
}

namespace Mint {
	struct mint {
		int x ;
		mint(int _x = 0) { x = _x ; }
		mint operator = (int _x) { return mint(x = _x); }
	};
	inline mint operator * (mint a, mint b) { return 1ll * a.x * b.x % mod ; }
	inline mint operator - (mint a, mint b) { return ((a.x -= b.x) < 0) ? a.x + mod : a.x ; }
	inline mint operator + (mint a, mint b) { return ((a.x += b.x) >= mod) ? a.x - mod : a.x ; }
	inline mint Pow(mint a, int b) { mint r = 1; while(b) { if(b & 1) r = r * a; a = a * a, b >>= 1; } return r; }
	inline mint operator / (mint a, mint b) { return a * Pow(b, mod - 2); }
	inline bool operator == (mint a, mint b) { return a.x == b.x; }
	ostream& operator << (ostream& out, mint b) { out << b.x; return out; }
}

int n, a[21], Lim, ans = 0x7fffffff;

int main () {

	scanf("%d", &n), Lim = 1 << n - 1;
	rep(i, 1, n) read(a[i]);

	dep(dev, Lim - 1, 0) {
		int now = 0, sum = 0;
		rep(i, 1, n) {
			now |= a[i];
			if (dev & (1 << i - 1))
				sum ^= now, now = 0;
		}
		sum ^= now, ans = min(ans, sum);
	}

	printf("%d", ans);

	return 0;
}

// Problem: C - ORXOR
// Contest: AtCoder - AtCoder Beginner Contest 197（Sponsored by Panasonic）
// URL: https://atcoder.jp/contests/abc197/tasks/abc197_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

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

void solve() {
    int n; cin>>n;
    int a[n];
    for(int i = 0; i<n; i++) cin>>a[i];
    int res = 0;
    for(int i = 0; i<n; i++) res ^= a[i];
    for(int mask = 0; mask < (1<<n); mask++) {
    	vector <int> dp;
    	for(int bit = 0; bit<n; bit++) {
    		if(mask & (1<<bit)) dp.pb(1);
    		else dp.pb(0);
    	}
    	int k = dp[0], tmp = 0, tmp_xor = 0;
    	for(int i = 0; i<n; i++) {
    		if(dp[i] == k) {
    			tmp |= a[i];
    		}
    		else {
    			tmp_xor ^= tmp;
    			tmp = a[i];
    		}
    	}
    	tmp_xor ^= tmp;
    	res = min(res, tmp_xor);
    }
    cout<<res<<endl;
}

signed main() {
	ThinkTwice
	int t;

	t = 1;
	// cin>>t;

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

//__________________________________________________________________
/*
Sample Input:

Sample Output:

*/


///                          BISMILLA HIRRAHMANIR RAHIM
///                              ALLAH IS ALMIGHTY
///                          ALLAH IS MUCH MORE CREATIVE

#include<bits/stdc++.h>
#define faster  ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb              push_back
#define ff              first
#define ss              second
#define mem(a,v)        memset(a, v, sizeof(a))
#define all(a)          (a).begin(), (a).end()
#define rep(i,n)        for(int i = 0; i < (n); ++i)

using namespace std;
using ll =                   int64_t;
using ii=                    pair<ll,ll>;
const double PI =            acos(-1.0);
const int mx =               1e5+5;

int dr[]= {0,-1,0,1,-1,-1,1,1};  /// first 4 are right,up,left,bottom
int dc[]= {1,0,-1,0,1,-1,-1,1};
int kx[]= {-1,-2,-2,-1,1,2,2,1};  /// knight move
int ky[]= {2,1,-1,-2,-2,-1,1,2};

bool valid(int row,int col){
    return (row>=1) && (row<=8) && (col>=1) && (col<=8);
}

ll a[mx],b[mx],su[mx];

void Solve()
{
   ll i,j,x,y,sum=0,ans=0,n,m,k,l=1;
   string dd,s="";cin>>dd;
   for(i=0; i<dd.size(); i++){
      if(dd[i]=='.') break;
      else s+= dd[i];
   }
   cout << s<< "\n";
}

int main()
{
    //faster;
   int TC=1;
   int jj=1;
    //cin >> TC;
    while(TC--) {
         Solve();
    }

    return 0;
}

#ifdef __LOCAL
#define _GLIBCXX_DEBUG
#endif

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

#pragma region macros

using str=string;
using ll=long long;
using vl=vector<ll>;
using vc=vector<char>;
using pl=pair<ll,ll>;
using ml=map<ll,ll>;
using sl=set<ll>;
using graph=vector<vector<ll>>;
template<class T> using V=vector<T>;
template<class T,class U> using P=pair<T,U>;

#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,n) for(ll i=1;i<n;i++)
#define REP(i,m,n) for(ll i=m;i<n;i++)
#define drep(i,n) for(ll i=n-1;i>=0;i--)
#define fore(n) for(auto&& i:n)
#define fors(n) for(auto&&[i,j]:n)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend();
#define sor(v) sort(all(v))
#define rsor(v) sort(all(v),greater<ll>())
#define rev(v) reverse(all(v))
#define low(v,x) lower_bound(all(v),x)-v.begin()
#define up(v,x) upper_bound(all(v),x)-v.begin()
#define acc(v) accumulate(all(v),0LL)
#define ef(x) emplace_front(x)
#define eb(x) emplace_back(x)
#define pf() pop_front()
#define pb() pop_back()
#define mp(a,b) make_pair(a,b)
#define ceil(a,b) (a+b-1)/b
#define bit(n) (1LL<<n)

#define fi first
#define se second
#define be begin()
#define en end()
#define br break
#define cn continue
#define wh while
#define el else if
#define re return

const ll inf=1LL<<60;
const ll mod=1000000007;
const ll MOD=998244353;
const double pi=3.1415926535;
const double eps=1e-10;
const ll dx[4]={1,0,-1,0};
const ll dy[4]={0,1,0,-1};

void input(){}
void inputs(){}
void output(){}
template<class T,class...U> void input(T& x,U&...y){cin>>x;input(y...);}
template<class...T> void in(T&...x){input(x...);}
template<class T> void inputs(const ll t,T& x){cin>>x[t];}
template<class T,class...U> void inputs(const ll t,T& x,U&...y){cin>>x[t];inputs(t,y...);}
template<class T,class...U> void inputs(T& x,U&...y){rep(t,size(x))inputs(t,x,y...);}
template<class...T> void ins(T&...x){inputs(x...);}
template<class T,class...U> void output(T x,U...y){cout<<x<<"\n";output(y...);}
template<class...T> void out(T...x){output(x...);}
template<class...T> void fin(T...x){out(x...);exit(0);}
template<class T> istream&operator>>(istream& i,V<T>& v){for(T& x:v)i>>x;re i;}
template<class T,class U> istream&operator>>(istream& i,P<T,U>& p){re i>>p.fi>>p.se;}
template<class T> ostream&operator<<(ostream& o,V<T>& v){for(T& x:v)o<<x<<" ";re o;}
template<class T,class U> ostream&operator<<(ostream& o,P<T,U>& p){re o<<p.fi<<" "<<p.se;}

void yn(bool b){fin((b?"Yes":"No"));}
void YN(bool b){fin((b?"YES":"NO"));}
void pos(bool b){fin((b?"POSSIBLE":"IMPOSSIBLE"));}
template<class T> void chmax(T& a,T b){if(a<b)a=b;}
template<class T> void chmin(T& a,T b){if(a>b)a=b;}
template<class T,class U> auto max(T a,U b){re a>b?a:b;}
template<class T,class U> auto min(T a,U b){re a<b?a:b;}
ll qp(ll x,ll n){ll r=1;wh(n>0){if(n&1)r*=x;x*=x;n>>=1;}re r;}
ll mdp(ll x,ll n){ll r=1;wh(n>0){if(n&1)r=r*x%mod;x=x*x%mod;n>>=1;}re r;}
ll MDp(ll x,ll n){ll r=1;wh(n>0){if(n&1)r=r*x%MOD;x=x*x%MOD;n>>=1;}re r;}

struct initialize{
    initialize(){
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout<<fixed<<setprecision(10);
    }
}init;

#pragma endregion

signed main(){
    ll n; in(n);
    vl a(n),b(n),c(n); in(a,b,c);

    ll ans=0;
    sor(a);
    rep(i,n){
        ll x=b[c[i]-1];
        ll y=low(a,x),z=up(a,x);
        ans+=max(z-y,0);
    }
    out(ans);
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long int
#define mod 1000000007
#define m 998244353

int main()
{
    ll a,b,c,ans=0;
    cin>>a>>b>>c;
    ll x=((a*(a+1))/2)%m;
    ll y=((b*(b+1))/2)%m;
    ll z=((c*(c+1))/2)%m;

    ans=(x*y)%m;
    ans=(ans*z)%m;
    cout<<ans;
}

#include<bits/stdc++.h>
typedef long long ll;
#define V(a) vector
#define P(a,b) pair
#define A(a) set
#define M(a,b) map
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define in insert
#define bp __builtin_popcount
#define ppb pop_back
#define FOR(a,b,c) for(ll(a) = b; a < c; a++)
#define FORN(a,b,c) for(ll(a) = b; a <= c; a++)
#define FOREV(a,b,c) for(ll(a)=b; a > c; a--)
#define FOREVN(a,b,c) for(ll(a)=b; a >= c; a--)
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
using namespace std;

bool cprime(int x)
{
    if (x == 1)
        return false;
    if (x <= 3)
        return true;
    if (x % 2 == 0 || x % 3 == 0)
        return false;
    for (int i = 5; i <= sqrt(x); i += 6)
        if (x % i == 0 || x % (i + 2) == 0)
            return false;
    return true;
}

bool cpalin(string s)
{
    int n = s.length(), l;
    if (n == 1)
        return true;
    if (n % 2 == 0)
        l = n / 2 - 1;
    else
        l = (n - 1) / 2 - 1;
    for (int i = 0; i <= l; i++)
        if (s[i] != s[n - i - 1])
            return false;
    return true;
}
void sieveOfEratosthenes(int n)
{
    bool arr[n + 1];
    FOR(i, 0, n + 1)
    arr[i] = true;
    for (int i = 2; i * i <= n; i++)
    {
        if (arr[i] == true)
        {
            for (int j = i * i ; j <= n; j += i)
            {
                if (arr[j] == true)
                    arr[j] = false;
            }
        }
    }
}

ll ndivs(ll n)
{
    int N = 1000;
    bool arr[N];
    FOR(i, 0, N)
    arr[i] = true;
    for (int i = 2; i * i <= N; i++)
    {
        if (arr[i] == true)
        {
            for (int j = i * i ; j <= N; j += i)
            {
                if (arr[j] == true)
                    arr[j] = false;
            }
        }
    }

    ll p = 1;
    FOR(i, 2, N)
    {
        if (arr[i] == true && n % i == 0)
        {
            ll m = 0; ll cp = n;
            while (cp % i == 0)
            {
                cp /= i;
                m++;
            }
            p *= (m + 1);
        }
    }
    return p;
}
bool compare( ll a,  ll b) // false return swap
{
    return a > b;
}

ll power( ll a, ll b)
{
    ll p = 1;
    while (b > 0)
    {
        if (b & 1)
            p *= a;
        a *= a;
        b >>= 1;
    }
    return p;
}

string dtobin(ll n)
{
    string s;
    while (n)
    {
        s = to_string((n % 2)) + s;
        n /= 2;
    }
    return s;
}

ll bintod(string s)
{
    ll n = 0;
    FOR(i, 0, s.length())
    if (s[i] == '0')
        continue;
    else
        n += pow(2, (s.length() - 1 - i));
    return n;
}

ll sdigs(ll n)
{
    int s = 0;
    while (n)
    {
        s += n % 10;
        n /= 10;
    }
    return s;
}

ll fact(ll p)
{
    int x = 1;
    FORN(i, 1, p)
    x *= i;

    return x;
}
ll ncr(ll n , ll r)
{
    ll ans = (fact(n) ) / (fact(r) * fact(n - r));
    return ans;
}

ll count(ll n)
{
    ll c = 0;

    return c;

}
int main() {

#ifndef ONLINE_JUDGE
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
    fastio;

    ll a, b, c;
    cin >> a >> b >> c;
    ll N = 998244353;
    ll x = ((a % N) * ((a + 1) % N)) / 2 % N;
    ll y = ((b % N) * ((b + 1) % N)) / 2 % N;
    ll z = ((c % N) * ((c + 1) % N)) / 2 % N;
    x %= N;
    y %= N;
    z %= N;
    ll p = (x % N * y % N) % N;
    ll q = (p % N * z % N) % N;
    cout << q;

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <map>
#include <set>
#include <vector>

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

    std::map<int, std::vector<int>> Map;
    for(int i = 0; i < M; i++){
        int X, Y;
        scanf("%d %d", &X, &Y);
        Map[X].emplace_back(Y);
    }

    std::set<int> Set{N};
    for(auto [key, Vec] : Map){
        std::set<int> SetIn, SetOut;
        for(int y : Vec){
            if(Set.find(y - 1) != Set.find(y + 1)) SetIn.insert(y);
            else SetOut.insert(y);
        }
        for(int in : SetIn) Set.insert(in);
        for(int out : SetOut) Set.erase(out);
    }

    printf("%d\n", (int)Set.size());

    return 0;
}

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

#define int long long
using ll = long long;
using P = pair<int,int>;

int n,m;

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

  map<int,int> cnt;
  vector<P> p(m);
  for(int i=0;i<m;i++){
    cin >> p[i].first;
    cin >> p[i].second;
    cnt[p[i].first]++;
  }

  sort(p.begin(),p.end());

  //for(int i=0;i<m;i++){
  //  cout << "i=" << i << ":" << p[i].first << "," << p[i].second << endl;
  //}

  vector<int> d(2*m+1,0);

  d[m] = 1;

  int j = 0;
  map<int,int> manip;
  for(auto it = cnt.begin(); it != cnt.end(); it++){
    int v = it->first;
    // cout << "it->first=" << it->first << endl;
    // int c = it->second;
    manip.clear();
    int j2 = j;
    while( p[j].first == v ){
      int y = p[j].second;    // n座標系
      int y2 = ( y - n ) + m; // m座標系
      if( y2 >= 0 && y2 <= 2*m ){
        manip[y2] = 0;
      }
      j++;
    }
    j = j2;
    while( p[j].first == v ){
      int y = p[j].second;     //
      int y2 = ( y - n ) + m;  // m
      if( y2 >= 0 && y2 <= 2*m && y2-1 >= 0 && y-1>=0 && d[y2-1]==1 ){
        manip[y2]=1;
      }
      if( y2 >= 0 && y2 <= 2*m && y2+1 <=2*m && y+1<=2*n && d[y2+1]==1 ){
        manip[y2]=1;
      }
      j++;
    }
    for(auto x: manip){
      d[x.first] = x.second;
    }
    //for(int j=0;j<2*m+1;j++){
    //  cout << "," << d[j];
    //}
    //cout << endl;
  }
  int res = 0;
  for(int i=0;i<=2*m;i++){
    if(d[i]!=0) res++;
  }
  cout << res << endl;

}


#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define mydeb(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
//#define mydeb(fmt, ...)

int main()
{

    int n,m;
    cin >> n >> m;
    vector<int> a(m),b(m);
    rep(i,m)
    {
        cin >> a[i] >> b[i];
        --a[i];
        --b[i];
    }

    vector<vector<int>> g(n);
    rep(i,m)
    {
        g[a[i]].push_back(b[i]);
    }

    int total=0;
    rep(i,n)
    {
        int count=0;
        vector<bool> visited(n);
        queue<int> q;

        q.push(i);
        while (q.empty()==false)
        {
            int pp=q.front();
            q.pop();
            if (visited[pp]!=false)
            {
                continue;
            }

            visited[pp]=true;
            ++count;
            for (auto nn: g[pp])
            {
                if (visited[nn]==false)
                {
                    q.push(nn);
                }
            }
        }
        total+=count;
    }
    cout << total << endl;
}

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

#define INF  						1e15
#define EPS   						1e-9
#define MOD 						1000000007
#define Pi 							3.14159265358979323846264338327950288419716939937510

#define umap 						unordered_map
#define uset 						unordered_set
#define fi 							first
#define se 							second
#define ll 							long long
#define vi 							vector<int>
#define pii 						pair<int,int>
#define vll 						vector<ll>
#define pll							pair<ll,ll>
#define vvll						vector<vector<ll>>
#define pb 							push_back
#define pob 						pop_back
#define pf 							push_front
#define pof 						pop_front
#define maxE(a,n) 					*max_element(a,a+n);
#define minE(a,n) 					*min_element(a,a+n);
#define all(x) 						x.begin(), x.end()
#define rev(x)						reverse(all(x))
#define endl						"\n"

#define fast 						ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

#define rep(i,n)					for (ll  i=0;i<n;i++)
#define repd(i,n)					for (ll  i = n-1;i>=0;i--)
#define fori(i,a,n) 				for (ll  i=a;i<n;i++)
#define ford(i,a,n) 				for (ll  i=n-1;i>=a;i--)
#define trav(x,a)					for(auto x:a){cout<<x<<" ";}cout<<endl;

ll gcd(ll a, ll b) {	return __gcd(a, b);}
ll lcm(ll a, ll b) {return (a * b) / gcd(a, b);}
ll power(ll x, ll b, ll m) {ll p = 1; while (b > 0) {if (b & 1) {p = p * x; p %= m;} b >>= 1; x *= x; x %= m;} return p % m;}
void dbg(string s) {cout << s << endl;}

/*PBDS*/
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> PBDS;

// pbds.find_by_order(k) (return iterator to kth largest element(from 0))
// pbds.order_of_key(k) (return number of elements in set which are strictly less than k)

vector<vector<ll>> g;
vector<bool> vis;
vector<ll> dp;
ll cnt;

void dfs(ll i, ll parent) {
	if (i != parent)
		cnt++;
	vis[i] = true;

	for (auto nbr : g[i]) {
		if (vis[nbr] != true) {
			dfs(nbr, i);
		}
	}

	return;
}

void solve() {

	ll n, m;
	cin >> n >> m;

	g = vector<vector<ll>>(n + 1);

	dp = vector<ll>(n + 1, 0);
	cnt = 0;
	rep(i, m) {
		ll u, v;
		cin >> u >> v;

		g[u].pb(v);
	}

	fori(i, 1, n + 1) {
		vis = vector<bool>(n + 1, false);
		dfs(i, 0);
	}

	cout << cnt << endl;
}

int main() {

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

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