#include <algorithm>
#include <iostream>
#include <list>
#include <queue>
#include <vector>

using namespace std;

struct AdjacentVertex {
  int vert_idx;
  int edge_c;
};

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

  vector<list<AdjacentVertex>> graph(n);

  for (int i = 0; i < m; ++i) {
    int u, v, c;
    cin >> u >> v >> c;
    AdjacentVertex av;
    av.edge_c = c;
    av.vert_idx = v - 1;
    graph[u - 1].push_back(av);
    av.vert_idx = u - 1;
    graph[v - 1].push_back(av);
  }

  vector<int> vert_vals(n);  // 頂点に書き込まれた整数
  vert_vals[0] = 1;

  queue<int> q;
  q.push(0);

  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (const auto &av : graph[u]) {
      const int v = av.vert_idx;
      if (0 == vert_vals[v]) {
        int vert_val_u = vert_vals[u];
        vert_vals[v] = vert_val_u == av.edge_c ? 1 + vert_val_u % n : av.edge_c;
        q.push(v);
      }
    }
  }

  if (find(vert_vals.cbegin(), vert_vals.cend(), 0) == vert_vals.cend()) {
    for (int val : vert_vals) {
      cout << val << endl;
    }
  } else {
    cout << "No" << endl;
  }

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int MOD=1e9+7;

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

	int n,m;
	cin>>n>>m;

	vector<pair<int,int>> vp(m);

	map<int,int> lj;
	map<int,map<int,int>> ed;

	for(auto &p:vp){
		int i,j;
		cin>>i>>j;
		p={i,j};
		lj[j-1]=0;
		lj[j]=0;
		lj[j+1]=0;
		ed[0][j-1]=0;
		ed[0][j]=0;
		ed[0][j+1]=0;
	}
	lj[n]=0;
	ed[0][n]=1;
	sort(vp.begin(),vp.end());
	queue<pair<int,int>> del;
	for(auto p:vp){
		int i=p.first, j=p.second;
		while(del.size() && del.front().first<i){
			lj[del.front().second]=del.front().first;
			del.pop();
		}
		int ijm=lj[j-1], ijp=lj[j+1];
		ed[i][j] = ed[ijm][j-1] || ed[ijp][j+1];
		del.push({i,j});
	}

	while(del.size()){
		lj[del.front().second]=del.front().first;
		del.pop();
	}
	int ans=0;
	for(auto p:lj){
		int j=p.first, i=p.second;
		ans+=ed[i][j];
	}
	cout<<ans;

    return 0;
}


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

#define rep(i,n) for(long long i = 0; i < (n); i++)
#define REP(i,s,n) for(long long i = (s); i <= (n); i++)
#define repr(i,n) for(long long i = (n - 1); i >= 0; i--)
#define REPR(i,s,n) for(long long i = (s); i >= (n); i--)
#define all(v) (v).begin(), (v).end() //biginからendへ
#define rall(v) (v).rbegin(), (v).rend()
#define sumvec(v) accumulate(all(v), 0LL)
#define DOUBLE fixed << setprecision(15)
#define OK cerr << "OK\n"
#define OK1 cerr << "OK1\n"
#define OK2 cerr << "OK2\n"
#define sz(s) (long long)s.size()

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

//vectorの末尾参照は .back()を使おう。
//if(chmax(ans, i))

#define INT(...) int __VA_ARGS__; IN(__VA_ARGS__)
#define LL(...) long long __VA_ARGS__; IN(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__; IN(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__; IN(__VA_ARGS__)
#define STR(...) string __VA_ARGS__; IN(__VA_ARGS__)
#define LD(...) long double __VA_ARGS__; IN(__VA_ARGS__)

void scan(int& a){ cin >> a; }
void scan(long long& a){ cin >> a; }
void scan(char& a){ cin >> a; }
void scan(double& a){ cin >> a; }
void scan(string& a){ cin >> a; }
void scan(long double& a){ cin >> a; }

void IN(){}
template<class Head, class... Tail> void IN(Head& head, Tail&... tail){ scan(head); IN(tail...); }

//INT(a,b)とか使う

void YES(bool b) { cout << ((b) ? "YES\n" : "NO\n"); }
void Yes(bool b) { cout << ((b) ? "Yes\n" : "No\n"); }
void yes(bool b) { cout << ((b) ? "yes\n" : "no\n"); }
void Yay(bool b) { cout << ((b) ? "Yay!\n" : ":(\n"); }
void posible(bool b) { cout << ((b) ? "posible\n" : "imposible\n"); }
void Posible(bool b) { cout << ((b) ? "Posible\n" : "Imposible\n"); }
void POsIBLE(bool b) { cout << ((b) ? "POsIBLE\n" : "IMPOsIBLE\n"); }

//出力の形式に合わせて関数をキャスとする

const int inf = 1001001001;
const long long INF = ((1LL << 62) - (1LL << 31));
const long double pi = acos(-1.0);

int main(){

    LL(n);
    set<ll> ans;
    for(ll i = 2; i * i <= n; i++){
        ll x = i * i;
        while(x <= n){
            ans.insert(x);
            x *= i;
        }
    }
    cout << n - ans.size() << endl;
}

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

typedef long long ll;

int main(){
	ll n, a, x;
	cin >> n;
	set<ll> st;

	for (a=2; a<=sqrt(n); a++){
		x = a * a;
		while (x <= n){
			st.insert(x);
			x *= a;
		}
	}

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


#include<stdio.h>
#include<stdlib.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=(c==45),c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(int x){if(x<0){putchar('-'),x=-x;}if(x>=10){OUT(x/10);}putchar(x%10+48);}
static inline int Asc(const void *a,const void *b){return *(int*)a-*(int*)b;}
const int ten[10]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};
static inline int f(int x)
{
  int num[10]={0},d=0,g1=0,g2=0;while(x){num[d++]=x%10;x/=10;}
  qsort(num,d,sizeof(*num),Asc);
  rep(i,d){g1+=num[i]*ten[i];g2+=num[i]*ten[d-1-i];}
  return g1-g2;
}
int main(void)
{
  int N=IN(),K=IN(),temp=0;
  rep(i,K){temp=N;N=f(N);if(!N){return !puts("0");}if(temp==N){return OUT(N),0;}}
  OUT(N);
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%I64d",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)
#define INF                         (int)1e9
#define EPS                         1e-9
#define bitcount                    __builtin_popcount
#define gcd                         __gcd
#define forall(i,a,b)               for(int i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((int)(a.size()))
#define mp                          make_pair
#define MOD                         1000000007
typedef long long ll;
/*For you see , each day i love you
 more.Today more than yesterday
  less than tomorrow.*/
using namespace std;
int g1(int x)
{
	vector<int> vec;
	while(x)
	{
		vec.push_back(x%10);
		x/=10;
	}
	sort(vec.begin() , vec.end());
	for(int i = (int)vec.size()-1;i>=0;i--)
	{
		x*=10;
		x+=vec[i];
	}
	return x;
}
int g2(int x)
{
	vector<int> vec;
	while(x)
	{
		vec.push_back(x%10);
		x/=10;
	}
	sort(vec.begin() , vec.end());
	for(int i = 0;i < vec.size() ;i++)
	{
		x*=10;
		x+=vec[i];
	}
	return x;
}
int f(int x)
{
	return g1(x) - g2(x);
}

int main()
{
	int n,k;cin>>n>>k;
	int a = n;
	for(int i = 1;i<=k;i++)
	{
		a = f(a);
	}
	cout<<a<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
// #include <atcoder/all>
// #include "icld.cpp"
using namespace std;
using ll = long long int;
using vi = vector<int>;
using si = set<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using ss = string;
using db = double;
template<typename T> using minpq = priority_queue <T,vector<T>,greater<T>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
#define V vector
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(i,s,n) for(int i=(s);i<(int)(n);i++)
#define rev(i,s,n) for(int i=(s);i>=(int)(n);i--)
#define reciv(v,n) vi (v)((n)); rep(i,0,(n))cin>>v[i]
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ci(x) cin >> x
#define cii(x) ll x;cin >> x
#define cci(x,y) ll x,y;cin >> x >> y
#define co(x) cout << x << endl
#define pb push_back
#define eb emplace_back
#define rz resize
#define sz(x) int(x.size())
#define yn cout<<"Yes"<<endl;else cout<<"No"<<endl
#define YN cout<<"YES"<<endl;else cout<<"NO"<<endl
template<class T>void chmax(T &x,T y){x=max(x,y);}
template<class T>void chmin(T &x,T y){x=min(x,y);}
// segment tree
vector<int> seg_t;int seg_sz=1;
int seg_func_init(int l,int r){return
/*関数書換*/    l^r;}
int seg_content(int i){return seg_t[seg_sz+i-1];}
void seg_sz_init(int vec_sz,int init_num){while(seg_sz<vec_sz)seg_sz<<= 1;seg_t.resize(seg_sz*2-1,init_num);}
void seg_init(int index,int x){ int now = index+seg_sz-1;seg_t[now] = x;
    while(now){int par=(now-1)/2; int chi=par*2+1; if(now==chi)chi++;seg_t[par]=seg_func_init(seg_t[now],seg_t[chi]);now=par;}}
int seg_func(int a,int b,int now=0,int l=0,int r=seg_sz){if(a<=l && r<=b)return seg_t[now];if(r<=a || b<=l)return 0;
    int hf=(l+r)/2;int chi_l=seg_func(a,b,now*2+1,l,hf);int chi_r=seg_func(a,b,now*2+2,hf,r);return seg_func_init(chi_l,chi_r);}

int main(){
    cci(n,q);
    reciv(v,n);
    seg_sz_init(n,0);

    rep(i,0,n)seg_init(i,v[i]);
    vi ans;

    rep(i,0,q){
        cii(t);
        cci(x,y);
        x--;

        if(t==1){
            int now=seg_content(x);
            seg_init(x,now^y);
        }
        else {
            ans.pb(seg_func(x,y));
        }
    }

    for(int ret:ans)co(ret);
}

#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

vs64 a, b;
vector< vs32 > g;
vector< bool > reached;

bool dfs(int u, s64& suma, s64& sumb)
{
    bool ret = true;
    reached[u] = true;
    suma += a[u];
    sumb += b[u];
    for (auto& v : g[u])
    {
        if (!reached[v])
        {
            ret = dfs(v, suma, sumb);
        }
    }
    return suma == sumb;
}

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

    int n, m;
    cin >> n >> m;
    a.resize(n), b.resize(n);
    rep (i, n) cin >> a[i];
    rep (i, n) cin >> b[i];

    g.resize(n);
    reached.resize(n, false);
    rep (i, m)
    {
        int u, v;
        cin >> u >> v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    bool ans = true;
    s64 suma, sumb;
    rep (i, n)
    {
        if (!reached[i])
        {
            suma = 0; sumb = 0;
            ans &= dfs(i, suma, sumb);
        }
    }

    cout << (ans ? "Yes\n" : "No\n");
    return 0;
}


/* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define SZ(x)               ((int)(x).size())
#define all(x)              (x).begin(), (x).end()
#define loop(i, n)          for(int i = 0; i < (n); ++i)
#define cont(i, n)          for(int i = 1; i <= (n); ++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 foreach(it, v)      for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); ++it)
#define y0          y0O0OO00OO0OO0OO0OOO00OO0OO0O0O000OO0
#define y1          y1II11II11III11I1III11II111IIII1II1I1
#define pub         push_back
#define pob         pop_back
#define mak         make_pair
typedef long long   ll;
typedef long double lf;
const int   Inf = 0x3f3f3f3f;
const ll    INF = 0x3f3f3f3f3f3f3f3fll;
/* Source code starts here */

template<int jt> struct ModInt {
	int x;
	ModInt(int v = 0) {x = v; if(x >= jt || x < 0) {x %= jt; if(x < 0) x += jt;}}
	ModInt(ll v) {x = v % jt; if(x < 0) x += jt;}
	operator int() const {return x;}
	friend inline ModInt &operator+=(ModInt &a, const ModInt &b) {a.x += b.x; if(a.x >= jt) a.x -= jt; return a;}
	friend inline ModInt operator+(ModInt a, const ModInt &b) {return a += b;}
	friend inline ModInt operator+(ModInt a, int b) {return a += ModInt(b);}
	friend inline ModInt operator+(int a, ModInt b) {return b += ModInt(a);}
	friend inline ModInt &operator++(ModInt &a) {return a += 1;}
	friend inline ModInt &operator-=(ModInt &a, const ModInt &b) {a.x -= b.x; if(a.x < 0) a.x += jt; return a;}
	friend inline ModInt operator-(ModInt a, const ModInt &b) {return a -= b;}
	friend inline ModInt operator-(ModInt a, int b) {return a -= ModInt(b);}
	friend inline ModInt operator-(int a, ModInt b) {return ModInt(a) - b;}
	friend inline ModInt &operator--(ModInt &a) {return a -= 1;}
	friend inline ModInt &operator*=(ModInt &a, const ModInt &b) {a.x = (ll)a.x * b.x % jt; return a;}
	friend inline ModInt operator*(ModInt a, const ModInt &b) {return a *= b;}
	friend inline ModInt operator*(ModInt a, int b) {return a *= ModInt(b);}
	friend inline ModInt operator*(int a, ModInt b) {return b *= ModInt(a);}
	static inline void exgcd(ll a, ll b, ll &x, ll &y) {b ? (exgcd(b, a % b, y, x), y -= a / b * x) : (x = 1, y = 0);}
	friend inline ModInt inv(const ModInt &a) {ll x, y; exgcd(a, jt, x, y); return x;}
	friend inline ModInt operator/(const ModInt &a, const ModInt &b) {return a * inv(b);}
	friend inline ModInt operator/(ModInt a, int b) {return a * inv(ModInt(b));}
	friend inline ModInt operator/(int a, ModInt b) {return ModInt(a) * inv(b);}
	friend inline ModInt operator/=(ModInt &a, const ModInt &b) {return a = a / b;}
};
const int jt = 998244353;
typedef ModInt<jt> mint;

int n, k;
mint dp[3005][3005];

int main() {
	scanf("%d%d", &n, &k);
	dp[0][0] = 1;
	cont(i, n) range(j, n, 1, -1) {
		if(j <= n / 2) dp[i][j] += dp[i][j * 2];
		if(j) dp[i][j] += dp[i - 1][j - 1];
	}
	printf("%d\n", dp[n][k]);
	return 0;
}

#line 1 "/workspaces/compro/lib/template.hpp"

#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>

#ifndef IO_VECTOR
#define IO_VECTOR

template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
  int size = v.size();
  for (int i = 0; i < size; i++) {
    std::cout << v[i];
    if (i != size - 1)
      std::cout << " ";
  }
  return out;
}

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

#endif
#line 4 "/workspaces/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}

#line 2 "main.cpp"

long long solve(long long A, long long B, long long C, long long D) {
  if (D * C - B <= 0)
    return -1;
  ll a = A;
  ll b = 0;
  REP(i, 1e6) {
    a += B;
    b += D * C;
    if (a <= b)
      return i + 1;
  }
  assert(false);
}

// generated by online-judge-template-generator v4.7.1 (https://github.com/online-judge-tools/template-generator)
int main() {
  long long A, B, C, D;
  std::cin >> A >> B >> C >> D;
  auto ans = solve(A, B, C, D);
  std::cout << ans << std::endl;
  return 0;
}


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

int main(){
    ll a,b;
    cin >> a >> b;
    int ans = 1;
    for(int i = 1; i <= 200000; i++){
        if(a % i != 0){
            if(a <= i * (a / i + 1) && i * (a / i + 1) <= b){
                if(a <= i * (a / i + 2) && i * (a / i + 2) <= b){
                    ans = max(ans,i);
                }
            }
        }
        else{
            if(a <= i * (a / i + 1) && i * (a / i + 1) <= b){
                ans = max(ans,i);
            }
        }
    }
    cout << ans << endl;
}

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

#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define fi first
#define se second
#define wt(a) cout<<a[0];for(int i=1; i<a.size(); i++)cout<<" "<<a[i];cout<<endl;
#define V vector

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

template<class T> vector<T> vec(int n, T val){vector<T>ret(n, val);return ret;}

using ll=long long;

signed main(){
    int n;
    cin>>n;
    V<int>a(n);
    rep(i,n)cin>>a[i];
    int maxi=-1, maxv=-1;
    for(int i=2; i<=1000; i++){
        int cnt=0;
        rep(j,n){
            if(a[j]%i==0){
                cnt++;
            }
        }
        if(maxv<cnt){
            maxv=cnt;
            maxi=i;
        }
    }
    cout<<maxi<<endl;
}


#include <iostream>
#include <vector>
using namespace std;
using i64 = long long;

int main()
{
    i64 n, w;
    cin >> n >> w;
    vector<i64> imos(2 * 100000 + 1, 0ll);

    for (int i = 0; i < n; i++)
    {
        i64 s, t;
        i64 p;
        cin >> s >> t >> p;
        imos[s] += p;
        imos[t] -= p;
    }

    for (int i = 1; i < imos.size(); i++)
    {
        imos[i] += imos[i - 1];
    }

    bool f = true;
    for (auto s : imos)
    {
        if (s > w)
            f = false;
    }

    if (f)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

  /* Great things never come from comfort zones,
  "whatever the mind of a man can conceive and believe,it can achieve." */

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

  #define ll long long
  #define dd double
  #define scf(n) scanf("%d",&n)
  #define lscf(n) scanf("%lld",&n)
  #define lpri(n) printf("%lld ",n)
  #define pri(n) printf("%d ",(int)n)
  #define prin(n) printf("%d\n",(int)n)
  #define lprin(n) printf("%lld\n",n)
  #define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
  #define show(a) for(auto xy: a) pri(xy); printf("\n");

  #define pb push_back
  #define mp make_pair
  #define F first
  #define S second
  #define all(x)     x.begin(),x.end()
  #define tc   int tt; scf(tt); while(tt--)

  #define inf INT_MAX
  #define ninf INT_MIN
  #define gcd __gcd
  #define bitcount(n) __builtin_popcount(n)

  const ll mod=1e9+7;
  const int N = 1e6+7;

  void my_dbg() { cout << endl; }
  template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B)
  { cout << ' ' << A; my_dbg(B...); }
  #define dbg(...) cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

  ll x[N];

  int main()
  {
         int n,w;
         scf(n),scf(w);

         rep(i,0,n)
         {
            int a,b;
            scf(a),scf(b);

            int p ; scf(p);

            x[a]+=p;

            x[b]+=(-p);

          }

          rep(i,1,n)
          x[i]+=x[i-1];

          bool f=1;

          rep(i,0,n)
          if(x[i]>w)f=0;

          if(f)
          printf("Yes\n");

          else
          printf("No\n");
  }

       // printf("NO\n");

       //  printf("YES\n");


#include<bits/stdc++.h>

#define fer( a , b , c ) for( register int a = b ; a <= c ; a ++ )
#define der( a , b , c ) for( register int a = b ; a >= c ; a -- )

  using namespace std ;

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

int a ;

signed main(){
	a = read() ;
	printf( "%d" , max( 0 , a ) ) ;
 	return 0 ;
}

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

int N, ans[100005], lp[100005];

void Sieve() {

	vector<int> v;
	for(int i = 2; i <= N; i++) {
	    if (lp[i] == 0) {
	        lp[i] = i;
	        v.push_back(i);
	    }
	    for(int j = 0; j < (int)v.size() && v[j] <= lp[i] && i*v[j] <= N; j++) {
	        lp[i * v[j]] = v[j];
	    }
	}
}

int main() {

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

	cin >> N;

	Sieve();

	cout << "1 ";
	for(int i = 2; i <= N; i++) {
		if(lp[i] == i) {
			ans[i] = 2;
		} else {
			ans[i] = ans[i/lp[i]] + 1;
		}
		cout << ans[i] << ' ';
	}
	cout << '\n';
}


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

vector<vector<char>> mat;
vector<vector<char>> in;
int n,m;

void answer_print(){
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cout << mat[i][j] ;
            if(j==n-1) cout << endl;
        }
    }
}

bool isPut(int x,int y,vector<char> str){
    if(mat[y][x] != '.') return false;
    if(n-x+1 < str.size()) return false;
    return true;
}

void Put(int x,int y,vector<char> str){
    for(int i = x;i<x+str.size();i++){
        mat[y][i] = str[i-x];
    }
}

void solve(){
    int k=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(isPut(j,i,in[k])) {
                Put(j,i,in[k]);
                k++;
            }
        }
    }
}

int main(){

    // input
    cin >> n >> m;
    mat.resize(n);in.resize(m);
    for(int i=0;i<n;i++) mat[i].resize(n,'.');

    string tmp;
    for(int i=0;i<m;i++) {
        cin >> tmp;
        in[i].resize(tmp.size());
        for(int j=0;j<tmp.size();j++){
            in[i][j] = tmp[j];
        }
    }

    solve();

    answer_print();

}

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

#define ll long long
#define mod 1000000007
#define pll pair<long long,long long>
#define pdd pair<long double,long double>
#define vll vector<ll>
#define rep(i,j,n) for(int i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
#define inf 1e17
#define N 200010
priority_queue<pll,vector<pll>,greater<pll> >pq;
priority_queue<ll,vector<ll>,greater<ll> >pq1;

ll result(ll a, ll b, ll p){
    ll ans=1;
    if(b==(-1))
        b=p-2;
    while(b){
        if(b&1){
            ans=(ans*a)%p;
        }
        a=(a*a)%p;
        b>>=1;
    }
    return ans;
}

ll T = 1,n,m,k;

int main(){
    if(fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin),
    freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    // cin >> T;
    while(T--){
        cin >> n >> k;
        ll a[n];
        map<ll, ll>m;
        for(int i=0;i<n;i++){
            cin >> a[i];
            m[a[i]]++;
        }
        ll ans = 0;
        ll d = 0;
        ll q = k;
        for(int i=0;i<n;i++){
            ll p = min(m[i], q);
            ans += (q-p)*d;
            d++;
            if(p==0 || q<=0)
                break;
            // cout << q << " " << p << "\n";
            q=p;
        }
        cout << ans <<"\n";

    }

    return 0;
}


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

int main(){

    ll H, W;
    cin >> H >> W;
    auto A = make_vec(H, W, 0ll);

    ll mi = INF;
    REP(i, H){
        REP(j, W){
            cin >> A[i][j];
            chmin(mi, A[i][j]);
        }
    }

    ll res = 0;
    REP(i, H){
        REP(j, W){
            res += (A[i][j] - mi);
        }
    }

    cout << res << endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int h,w;
vector <int> a;
int main(){
    cin >> h >> w;
    a = vector<int>(h*w);
    int minimum = INT_MAX;
    for(int i = 0; i < h*w; i++){
        cin >> a[i];
        minimum = min(a[i],minimum);
    }
    long long ans = 0;
    for(int i = 0; i < h*w; i++){
        if(minimum!=a[i]){
            ans += a[i] - minimum;
        }
    }
    cout << ans << endl;

    return 0;
}


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

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

  cout<<21-a-b-c<<endl;}

#include<bits/stdc++.h>
using namespace std;
typedef long long li;
typedef long double ld;
typedef pair<int,int> pt;
typedef pair<ld, ld> ptd;
typedef unsigned long long uli;

#define SORT(vec) sort(vec.begin(), vec.end())
#define loop(i,a,n) for(int i=a;i<n;i++)
#define pb push_back
#define mp make_pair
#define mset(a, val) memset(a, val, sizeof (a))
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define ft first
#define sc second
#define sz(a) int((a).size())
#define x first
#define y second

const int INF = int(1e9);
const li INF64 = li(INF) * li(INF);
const ld EPS = 1e-9;
const ld PI = ld(3.1415926535897932384626433832795);
int main(){
float x,y,z;
cin>>x>>y>>z;
int i=0;
while(1){
	if(float(y/x)<=float(i/z)){
		cout<<i-1;break;
	}
	i++;
}
return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

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

const int N=0;

int gcdExtended(int a, int b, int* x, int* y);

// Function to find modulo inverse of a
int modInverse(int a, int m)
{
    int x, y;
    int g = gcdExtended(a, m, &x, &y);
    if (g != 1)
	    return -1;
    else
    {
        // m is added to handle negative x
        int res = (x % m + m) % m;
        return res;
    }
}

// C function for extended Euclidean Algorithm
int gcdExtended(int a, int b, int* x, int* y)
{
    // Base Case
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }

    int x1, y1; // To store results of recursive call
    int gcd = gcdExtended(b % a, a, &x1, &y1);

    // Update x and y using results of recursive
    // call
    *x = y1 - (b / a) * x1;
    *y = x1;

    return gcd;
}

void solve(){
	int n,s,k;
	cin>>n>>s>>k;
	s=n-s;
	// fin min b s.t. k*b % n ==s
	int g=__gcd(k,n);
	if(s%g!=0){
		cout<<-1<<"\n";
		return;
	}
	k/=g;
	n/=g;
	s/=g;
	int inv=modInverse(k,n);
	int b=(inv*s)%n;
	cout<<b<<"\n";

}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#ifdef SIEVE
		sieve();
	#endif
	#ifdef NCR
		init();
	#endif
	int t=1;
	cin>>t;
	while(t--) solve();
	return 0;
}

// Problem : E - Throne
// Contest : AtCoder - Panasonic Programming Contest (AtCoder Beginner Contest 186)
// URL : https://atcoder.jp/contests/abc186/tasks/abc186_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// God & me
// Fly ...
//#pragma GCC optimize "trapv"//  WA to RE int!!
#include <bits/stdc++.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORR(i,n) for(int i=n;i>=0;i--)
#define pb push_back
#define vint vector<int>
#define sint set<int>
#define mint map<int,int>
#define pint pair< int,int >
#define int long long int
#define test int tt1234; cin>>tt1234;while(tt1234--)
#define endl "\n"
#define input(a,n) int n;cin>>n;vint a(n);for(int&v:a)rd(v);
#define all(zz) zz.begin(),zz.end()
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define error(x) cerr << #x <<" is " << x << endl;
#define Error(a,b) cerr<<"( "<<#a<<" , "<<#b<<" ) = ( "<<(a)<<" , "<<(b)<<" )\n";
#define precision(x) cout<<fixed<<setprecision(x);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define present(container, element) (container.find(element)!=container.end())
#define fint fast;test
#define set(a,x) memset(a,x,sizeof(a))
#define L(x)	((x)<<1)
#define R(x)	(((x)<<1)+1)
#define ft first
#define se second
#define MOD 1000000007
using namespace std;
template<typename... T> void rd(T&... args) { ((cin >> args), ...); }
template<typename... T> void pp(T... args) { ((cout << args << " "), ...); cout<<"\n"; }
int mod_inverse(int a, int m){
    int b = m, x = 1, y = 0;
    while(b){
        //a * x + b * y = m
        int t = a / b;
        a -= t * b;
        x -= t * y;
        swap(a, b);
        swap(x, y);
    }
    x %= m;
    if(x < 0) x += m;
    return x;
}
void solve(){
	int n,s,k;
	rd(n,s,k);
	int g=__gcd(n,k);
	if(s%g)pp(-1);
	else
	{
		n/=g,s/=g,k/=g;
		int ans=((n-s)*mod_inverse(k,n))%n;
		pp(ans);
	}
	return;
}

int32_t main() {
    fint{
    	solve();
    }
    return 0;
}


#include <bits/stdc++.h>

/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
#define ALL(v) v.begin(), v.end()
template<class T> T rng(const T &a, const T &b){ return a < b ? b - a : a - b; }
template<class T> void chmaxmin(T &a, const T &b, const T &(*f)(const T &, const T &)){ a = f(a, b); }
#define chmax(a, b) chmaxmin(a, b, std::max)
#define chmin(a, b) chmaxmin(a, b, std::min)

#if __has_include(<experimental/iterator>)
#include <experimental/iterator>
auto debug = std::experimental::make_ostream_joiner(std::cout, " ");
#endif

/* snippet: inf struct */
#if __cplusplus >= 201703
struct{ template<class T> constexpr operator T(){ return std::numeric_limits<T>::max(); } constexpr auto operator-(); } inf;
struct{ template<class T> constexpr operator T(){ return std::numeric_limits<T>::lowest(); } constexpr auto operator-(); } negative_inf;
constexpr auto decltype(inf)::operator-(){ return negative_inf; }
constexpr auto decltype(negative_inf)::operator-(){ return inf; }
#endif

/* snippet: modint library */
#if __cpp_concepts
template<std::signed_integral T, T MOD>
#else
template<class T, T MOD>
#endif
class Modint{
	T val;
public:
	Modint(T val = 0) : val(val % MOD + (val >= 0 ? 0 : MOD)) {}
	operator T(){ return val; }
	Modint &operator+=(const Modint &a){ val += a.val; if(val >= MOD) val -= MOD; return *this; }
	Modint &operator-=(const Modint &a){ val -= a.val; if(val < 0) val += MOD; return *this; }
	Modint &operator*=(const Modint &a){ val = val * a.val % MOD; return *this; }
	void inverse(){T x[2]={MOD,val},a[2]={0,1};int i;for(i=0;x[!i];i^=1){a[i]-=x[i]/x[!i]*a[!i];x[i]=x[i]%x[!i];}if(!i)a[i]+= MOD;val=a[i];}
	Modint &operator/=(Modint a){ a.inverse(); return *this *= a; }
	friend Modint modpow(Modint a, int n){ Modint ret(1); while(n){ if(n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
	friend Modint operator+(Modint a, const Modint &b){ return a += b; }
	friend Modint operator-(Modint a, const Modint &b){ return a -= b; }
	friend Modint operator*(Modint a, const Modint &b){ return a *= b; }
	friend Modint operator/(Modint a, const Modint &b){ return a /= b; }
	friend std::ostream &operator<<(std::ostream &os, const Modint &a){ return os << a.val; }
};

/* push n numbers and get i-th min */
/* to get min and 2nd min, declare K_th_min<T, 2> and use get<0>(), get<1>() */
#if __cplusplus >= 201703
template<class T, std::size_t K>
class K_th_min{
	friend class K_th_min<T, K + 1>;
	T val;
	K_th_min<T, K - 1> lower;
	void push_(T &x){ lower.push_(x); if(val > x) std::swap(val, x); }
public:
	K_th_min() : val(std::numeric_limits<T>::max()) {}
	void push(T x){ push_(x); }
	template<std::size_t I> T get(){ if constexpr(I == K - 1) return val; else return lower.template get<I>(); }
};
template<class T> class K_th_min<T, 0>{ friend class K_th_min<T, 1>; void push_(T &){} public: K_th_min(){} void push(T){} };
#endif

/* snippet:  */
int fourd[] = {0, 1, 0, -1, 0};
int eightd[] = {0, 1, 1, -1, 0, -1, -1, 1, 0};

/* snippet: using declarations */
using Int = long long;
using lint = long long;
using std::cout;
using std::cin;
using std::endl;
using Mint = Modint<long long, 1000000007>;

int main(){
	lint n, m;
	cin >> n >> m;
	if(m < 0){
		cout << -1 << endl;
		return 0;
	}else if(m == 0){
		for(int i = 0; i < n; ++i){
			cout << 2 * i + 1 << " " << 2 * i + 2 << endl;
		}
		return 0;
	}
	if(n >= m + 2){
		cout << 1 << " " << 2 * m + 3 << endl;
		for(int i = 0; i < m; ++i){
			cout << i * 2 + 2 << " " << i * 2 + 3 << endl;
		}
		cout << 2 * m + 2 << " " << 2 * m + 4 << endl;
		for(int i = 0; i < n - m - 2; ++i){
			cout << 2 * m + 5 + i * 2 << " " << 2 * m + 5 + 2 * i + 1 << endl;
		}
	}else{
		cout << -1 << endl;
	}

}


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

int main()
{
vector<pair<ll,ll>> m;
ll n,Y;
cin>>n>>Y;

int a,b,c;
for(ll i=0;i<n;i++){
    cin>>a>>b>>c;
    m.emplace_back(a-1,c);
    m.emplace_back(b,-c);

}
sort(m.begin(),m.end());
ll charge=0,t=0,sum_total=0;
for(auto [x,y] : m){
    if(x!=t){
        sum_total+=min(charge,Y)*(x-t);
        t=x;
    }
    charge+=y;
}
cout<<sum_total;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int N=200005;
vector<int> tree(4*N,0);

void update(int idx,int l,int r,int pos,int val)
{
    if(l==r) tree[idx]=val;
    else
    {
        int m=(l+r)/2;
        if(pos<=m) update(2*idx,l,m,pos,val);
        else update(2*idx+1,m+1,r,pos,val);
        tree[idx]=tree[2*idx]+tree[2*idx+1];
    }
}

int query(int idx,int l,int r,int ql,int qr)
{
    if(ql>qr) return 0;
    if(l==ql&&r==qr) return tree[idx];
    int m=(l+r)/2;
    return query(2*idx,l,m,ql,min(qr,m))+query(2*idx+1,m+1,r,max(ql,m+1),qr);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m,x;
    cin >> n >> m >> x;
    vector<int> b(n+1,m+1);
    vector<int> a(m+1,n+1);
    for(int i=0;i<x;i++)
    {
        int r,c;
        cin >> r >> c;
        b[r]=min(b[r],c);
        a[c]=min(a[c],r);
    }
    vector<int> rm[n+2];
    for(int j=1;j<b[1];j++) rm[a[j]].push_back(j);
    for(int j=1;j<b[1];j++) update(1,1,m,j,1);
    ll res=0;
    for(int j=1;j<b[1];j++) res+=(a[j]-1);
    for(int i=1;i<a[1];i++)
    {
        for(int j:rm[i]) update(1,1,m,j,0);
        res+=(b[i]-1);
        res-=query(1,1,m,1,b[i]-1);
    }
    cout << res << "\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  long long a[n];
  long long b[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n;i++)
   cin>>b[i];

  multiset<long long,greater<long long>> m;
  long long max1=0;
  cout<<a[0]*b[0]<<endl;
  max1=a[0]*b[0];
  m.insert(max1);
  max1=a[0];
  for(int i=1;i<n;i++){
    max1=max(a[i],max1);
    m.insert(b[i]*max1);
    auto it=m.begin();
    cout<<*it<<endl;
  }

}

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

#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;++i)
#define per(i,a,b) for(int i=(a),i##end=(b);i>=i##end;--i)
//mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template<typename T>void chkmax(T&x,T y){if(x<y)x=y;}
template<typename T>void chkmin(T&x,T y){if(x>y)x=y;}
inline int read(){
  #define nc getchar()
  bool f=0;int x=0;char c=nc;
  while(c<48)f|=c=='-',c=nc;
  while(c>47)x=x*10+(c^48),c=nc;
  return f?-x:x;
  #undef nc
}

typedef double db;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int maxn=2e5+10;
int n,A[maxn],B[maxn];

void solve(){
  cin>>n;
  rep(i,1,n)A[i]=read();rep(i,1, n)B[i]=read();
  int v1=0,v2=0;ll ans=0;
  rep(i,1,n){
    chkmax(v1,A[i]);
    chkmax(ans,1ll*v1*B[i]);
    printf("%lld\n",ans);
  }
}

signed main(){
//  int T=read();
//  while(T--)solve();
  solve();
  return 0;
}


// Problem: C - Coprime Set
// Contest: AtCoder - AtCoder Regular Contest 118
// URL: https://atcoder.jp/contests/arc118/tasks/arc118_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define vi vector<int>
#define vll vector<ll>
#define all(x) (x).begin() , (x).end()

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rnd(x, y) uniform_int_distribution<ll>(x, y)(rng)

void dbg(){
	cerr << endl;
}
template<typename Head , typename... Tail>
void dbg(Head h , Tail... t){
	cerr << h << " ";
	dbg(t...);
}

#ifdef EMBI_DEBUG
#define debug(...) cerr << "(" << #__VA_ARGS__  << "): ", dbg(__VA_ARGS__)
#else
#define debug(...)
#endif

const int max_n = 1e5 + 9;
const int mod = 1e9 + 7;
const int inf = 1e9;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
ll power(ll a , ll b)
{
    ll prod = 1;
    while(b)
    {
        if(b&1)
        prod = (prod*a)%mod;
        a = (a*a)%mod;
        b >>= 1;
    }
    return prod;
}
void solve(){
	int n;
	cin >> n;

	int idx = 1;
	set<int> st;
	vector<int> v1{6 , 10 , 15};
	int index = 0;
	for(int i = 1 ; i < n-1 ; i++) {
		while(st.count(idx*v1[index])) {
			idx++;
		}
		if(idx * v1[index] > 10000) {
			if(index == 2) {
				debug(index , i);
				break;
			}
			index++;
			idx = 2;
			i--;
			continue;
		}
		st.insert(idx * v1[index]);
	}
	debug("hi");

	assert(st.size() == n-2);

	vector<int> v;
	v.pb(10);
	for(auto it : st) {
		v.pb(it);
	}
	v.pb(15);

	for(int i = 0 ; i < n ; i++) {
		for(int j = i+1 ; j < n ; j++) {
			assert(__gcd(v[i] , v[j]) > 1);
		}
	}

	int hcf = 0;
	for(int i = 0 ; i < n ; i++)
		hcf = __gcd(hcf , v[i]);

	assert(hcf == 1);

	assert(!st.count(10));
	assert(!st.count(15));

	for(auto it : v) {
		cout << it << " ";
	}

}
signed main(){
	int t = 1;
	// cin >> t;
	for(int i = 1 ; i <= t ; i++){
		solve();
	}
}

#include<cstdio>
#include<vector>
#include<algorithm>
#include<set>
#include<unordered_map>
#include<string>
#include<iostream>
#include<cstring>
#include<cmath>
#include<queue>
using namespace std;
using ll = long long;
constexpr int N = 1e4 + 5;
constexpr int M = 2505;

int n;
bool vis[N];

int main() {
    scanf("%d", &n);
    printf("%d %d %d ", 6, 10, 15);
	vis[6] = vis[10] = vis[15] = 1;
	int cnt = 4;

	for(int i = 6; i <= 10000 && cnt <= n; i += 6) {
		if(!vis[i]) {
			++cnt;
			vis[i] = 1;
			printf("%d ", i);
		}
	}

	for(int i = 10; i <= 10000 && cnt <= n; i += 10) {
		if(!vis[i]) {
			++cnt;
			vis[i] = 1;
			printf("%d ", i);
		}
	}

	for(int i = 15; i <= 10000 && cnt <= n; i += 15) {
		if(!vis[i]) {
			++cnt;
			vis[i] = 1;
			printf("%d ", i);
		}
	}

    return 0;
}


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

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

	int n;
	cin >> n;
	int ans = 0;
	vector<int> a(n);
	vector<int> b(n);
	REP(i, n)
	{
		cin >> a[i];
	}
	REP(i, n)
	{
		cin >> b[i];
	}
	REP(i, n)
	{
		ans += a[i] * b[i];
	}
	if (ans == 0)
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;

int keisan(int num) {
    int goukei = 0;
    for (int i=0; i<3; i++) {
        goukei += num%10;
        num /= 10;
    }
    return goukei;
}

int main() {
    int a, b;

    cin >> a >> b;

    a = keisan(a);
    b = keisan(b);

    if (a > b) {
        cout << a;
    }else {
        cout << b;
    }
}


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

#define fi first
#define se second
#define rng(i, a, b) for (int i=int(a);i<int(b);++i)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i=int(b)-1;i>=int(a);--i)
#define per(i, b) gnr(i, 0, b)
#define all(obj) begin(obj), end(obj)
#define allr(obj) rbegin(obj), rend(obj)
#define cinv(a) rep(i,(int)a.size()) cin >> a[i]
#define debug(a) rep(i,(int)a.size()) cout << a[i] << " "
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define dame {puts("-1"); return 0;}
typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<Pi> vp;
typedef vector<vp> vvp;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;

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

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

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

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

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

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t; cin >> t;
	while(t--)
	{
		int n; cin >> n;
		string a, b, c; cin >> a >> b >> c;
		cout << string(n, '0') + string(n, '1') + '0' << nl;
	}
}

#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);
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        cin >> n;
        vector<string> s(3);
        vector<int> a(4);
        for (int i = 0; i < 3; i++) {
            cin >> s[i];
            a[(s[i][0] - '0') * 2 + (s[i].back() - '0')] = 1;
        }
        for (int i = 0; i < 4; i++) {
            if (!a[i]) {
                string ans;
                if (i == 0) {
                    ans += string(n, '0');
                    ans += "1";
                    ans += string(n, '0');
                } else if (i == 1) {
                    ans += string(n, '1');
                    ans += string(n, '0');
                    ans += "1";
                } else if (i == 2) {
                    ans += string(n, '0');
                    ans += string(n, '1');
                    ans += "0";
                } else {
                    ans += string(n, '1');
                    ans += "0";
                    ans += string(n, '1');
                }
                cout << ans << '\n';
                break;
            }
        }
    }
    return 0;
}


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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    vector<int> B(M);
    rep(n, N) {
        cin >> A[n];
    }
    rep(m, M) {
        cin >> B[m];
    }
    vector<int> C;
    set_symmetric_difference(A.begin(), A.end(), B.begin(), B.end(), back_inserter(C));
    for(int c: C) {
        cout << c << " ";
    }
    cout << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define KP                            \
	ios_base::sync_with_stdio(false); \
	cin.tie(NULL);
#define ll long long int
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define MIN -1e9
#define MAX 1e9
#define endl "\n"
#define vi vector<ll>
#define pb push_back
#define all(v) v.begin(), v.end()
#define output(x) cout << (x ? "YES" : "NO") << endl;
bool sortbysecdesc(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
	return a.second > b.second;
}

void solve()
{
	ll n, x;

	cin >> n >> x;

	map<ll, ll>m;

	rep(i, 0, n)
	{
		ll t;

		cin >> t;
		m[t]++;
	}

	rep(i, 0, x)
	{
		ll t;
		cin >> t;
		m[t]++;
	}

	for (auto i = m.begin(); i != m.end(); i++)
	{
		if (i->second == 1)
		{
			cout << i->first << " ";
		}
	}
}

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

	ll tt = 1;
	// cin >> tt;
	while (tt--)
		solve();

	// cout << "\n\n"
	//      << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";

	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
typedef long long ll;

int main(void)
{
	ll N,K;
	cin>>N>>K;
	ll ans=0;
	if(K<0){
		K*=-1;
	}
	for(ll i=2;i<=2*N-K;i++){
		ll j=i+K;
		if(i<=N && j<=N){
			ans+=(i-1)*(j-1);
		}else if(i>N && j>N){
			ans+=(2*N-i+1)*(2*N-j+1);
		}else if(i>N){
			ans+=(2*N-i+1)*(j-1);
		}else if(j>N){
			ans+=(i-1)*(2*N-j+1);
		}

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

	return 0;
}

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

ll pow_mod(ll x, ll n, ll mod) {
    ll ret = 1;
    while (n > 0) {
        if (n & 1) ret = ret * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return ret;
}

int main(){
  ll n, p;
  cin >> n >> p;
  ll mod = pow(10,9)+7;
  ll ans = ((p-1)*pow_mod(p-2, n-1, mod))%mod;
  cout << ans << endl;
  return 0;
}


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

using ll = long long;

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

    int ans = 0;
    for(ll i = 1; i <= 1000000; i++) {
        string s = to_string(i);
        string t = s + s;
        ll m = stoll(t);
        if(m<=n) {
            ans++;
        }
    }
    cout<<ans;
    return 0;
}

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

int main () {

string n, front, back;
cin >> n;

int len = n.length();

if (stoll(n) < 11) {
    cout << 0;
    return 0;
}

else if (len%2==1) {
    for (int i = 0; i < (len-1)/2;++i) {
        cout << '9';
    }
}
    else {
        for (int i = 0; i < len/2; ++i){
            front+=n[i];
        }
        for (int i = len/2; i < len; ++i){
            back+=n[i];
        }
        if (stoll(front) > stoll(back)) {
            cout << stoi(front)-1;
        }
        else {
            cout << front;

        }
    }
}


#include<bits/stdc++.h>
#define ll long long int
#define fab(a,b,i) for(int i=a;i<b;i++)
#define db double
#define endl "\n"
#define f first
#define se second
#define MOD 1000000007
#define quick ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res - MOD : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= MOD ? res % MOD : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + MOD : res);}
ll power(ll x, ll y) {ll res = 1; x %= MOD; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll mod_inv(ll x) {return power(x, MOD - 2);}

using namespace std;
ll a[10000000],b[10000000];
int main()
{
	quick;
#ifndef ONLINE_JUDGE
    freopen("C:/coding/input.txt", "r", stdin);
    freopen("C:/coding/output.txt", "w", stdout);
#endif

		ll n,sum=0;
		string s;
		cin>>n;
		for(int i=0;i<n;i++)
		cin>>a[i];
		for(int i=0;i<n;i++)
			cin>>b[i];
		for(int i=0;i<n;i++)
		{
			sum+=(a[i]*b[i]);
		}
		if(sum==0)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;

 cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
	return 0;
}

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

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

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

void solve() {
	ll n;

	cin>>n;
	string s;

	bool f = 0;

	map<string,int>mp1,mp2;
	for(int i=0;i<n;i++) {
		cin>>s;
		if(f) continue;
		if(s[0] == '!') {
			s = s.substr(1);
			if(mp1[s]) {
				cout<<s<<"\n";
				f = 1;
			}
			mp2[s]++;
		} else {
			if(mp2[s]) {
				cout<<s<<"\n";
				f = 1;
			}
			mp1[s]++;
		}
	}
	if(!f) cout<<"satisfiable\n";
}

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

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

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i=0;i<(int)(n);i++)
template <typename T> bool chmax(T &a, const T& b) {if (a < b) {a = b; return true;}return false;}
template <typename T> bool chmin(T &a, const T& b) {if (a > b) {a = b; return true;}return false;}
const int MOD = 1000000007;
ll x = 10000000000;

int main(){
  double x,y,z;
  cin>>x>>y>>z;
  double a = y/x;
  if(ceil(z*a)!=floor(z*a))cout<<int(z*a)<<endl;
  else cout<<(int)z*y/x-1<<endl;

}

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

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


//
// Created by myungki cho on 2/20/21.
//

//
// Created by myungki cho on 2/20/21.
//

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

using namespace std;

typedef long long ll;

set<ll> st;
ll n;
ll ans;

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

    for (ll i = 2; i * i <= n; i++) {
        ll cur = i;
        ll cnt = 1;
        while (cur <= n) {
            if (cnt >= 2) {
                if (st.find(cur) == st.end()) {
                    st.insert(cur);
                    ans++;
                }
            }
            cur *= i;
            cnt++;
        }
    }
    cout << n - ans;

}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// --------------------------------------------------------
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; }
#define FOR(i,l,r) for (ll i = (l); i < (r); ++i)
#define RFOR(i,l,r) for (ll i = (r)-1; (l) <= i; --i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define MIN(c) *min_element(ALL(c))
#define MAX(c) *max_element(ALL(c))
#define SUMLL(c) accumulate(ALL(c), 0LL)
#define SZ(c) ((ll)(c).size())
#define BIT(b,i) (((b)>>(i)) & 1)
#define PCNT(b) __builtin_popcountll(b)
#define CIN(c) cin >> (c)
#define COUT(c) cout << (c) << '\n'
#define debug(x) cerr << "l." << __LINE__ << " : " << #x << " = " << (x) << '\n'
ll llceil(ll a, ll b) { return (a + b - 1) / b; }
string toupper(const string& S) { string T(S); REP(i,SZ(T)) T[i] = toupper(T[i]); return T; }
string tolower(const string& S) { string T(S); REP(i,SZ(T)) T[i] = tolower(T[i]); return T; }
using P = pair<ll,ll>;
using VP = vector<P>;
using VVP = vector<VP>;
using VS = vector<string>;
using VVS = vector<VS>;
using VLL = vector<ll>;
using VVLL = vector<VLL>;
using VVVLL = vector<VVLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VVVB = vector<VVB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VVVD = vector<VVD>;
static const double EPS = 1e-10;
static const double PI  = acos(-1.0);
static const ll MOD = 1000000007;
// static const ll MOD = 998244353;
static const ll INF = (1LL << 62) - 1;  // 4611686018427387904 - 1
// --------------------------------------------------------
// #include <atcoder/all>
// using namespace atcoder;

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

    ll N; cin >> N;

    ll ans = N;
    ll root = floor(sqrt(N) + 0.5);
    VB B(root+1,true);
    FOR(a,2,root+1) if (B[a]) {
        ll y = a*a;
        while (y <= N) {
            ans--;
            y *= a;
        }
        for (ll j = a*a; j <= root; j *= a) B[j] = false;
    }
    COUT(ans);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll n;cin>>n;
	ll a[n+2];
	ll pos[n+2];
	vi ans;
	rep(i,1,n+1) {
		cin>> a[i];
		pos[a[i]] = i;
	}

	ll curr = 1;
	ll moves = 0 ;
	while(curr <= n) {
		if(pos[curr] == curr) {
			curr ++;
			continue;
		}

		// bring it to the correct position
		moves += pos[curr] - curr;
		if( moves >= n) {
			break;
		}

		for(ll i=pos[curr]-1;i>=curr;i--) {
			swap(a[i],a[i+1]);
			pos[a[i]] = i;
			pos[a[i+1]] = i+1;
			ans.pb(i);
		}
		curr ++ ;
	}
	if( ans.size() != n-1) {
		cout << -1 << endl;
		return 0;
	}
	rep(i,1,n+1) {
		if(a[i] != i) {
			cout << -1 << endl;
			return 0;
		}
	}
	for(auto it: ans) {
		cout << it <<endl;
	}
}

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

int main(){
  int N;
  cin >> N;
  int P;
  vector<int> pos(N+1),ans;
  for(int i=1;i<=N;i++){
    cin >> P;
    pos.at(P)=i;
  }
  for(int i=pos.at(1)-1;i>=1;i--){
    ans.emplace_back(i);
  }
  int ma=pos.at(1);
  for(int i=2;i<=N;i++){
    if(pos.at(i)<i){
    }else if(ma<=i){
      for(int j=pos.at(i)-1;j>=i;j--){
        ans.emplace_back(j);
      }
    }else{
      cout << -1 << endl;
      return 0;
    }
    ma=max(ma,pos.at(i));
  }
  if(ans.size()==N-1){
    for(int i=0;i<ans.size();i++){
      cout << ans.at(i) << endl;
    }
  }else{
    cout << -1 << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long

const ll OO = 0x3f3f3f3f;
const ll mod =   1e9 + 7;
const double pi = 3.14159265359;

//freopen("window.in", "r", stdin);
//freopen("output.out", "w", stdout);
void skrrrt() {
    ios_base::sync_with_stdio(0), cin.tie(0);
}
//###############################Spaggetti############################

int main(){
    skrrrt();
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[0]-a[1]==a[1]-a[2])cout<<"Yes";
    else cout<<"No";

}

#include <bits/stdc++.h>
#define endl "\n"
#define int long long

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};

template<typename T>
void printv(vector<T> v) {
  for (auto e : v) {
    cout << e << " ";
  } cout << endl;
}

template<typename T>
void printvv(vector<T> vv) {
  for (int i=0; i<vv.size(); i++) {
    cout << i << ": ";
    for (auto e : vv[i]) {
      cout << e << " ";
    } cout << endl;
  }
}

void io_util() {
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  #endif
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(17);
}

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

signed main() {
  io_util();

  int a, b, c;
  cin >> a >> b >> c;

  if (a > b) cout << "Takahashi" << endl;
  else if (a < b) cout << "Aoki" << endl;
  else {
    if (c==0) cout << "Aoki" << endl;
    else cout << "Takahashi" << endl;
  }

  return 0;
}


#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <math.h>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#pragma GCC optimize ("-O3")

using namespace std;

#define watch(x) cout << (#x) << " = " << (x) << endl
#define PI double(2 * acos(0.0))
#define ll long long
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
#define INF 1e15

int main()  {
        ios_base::sync_with_stdio(0);
        cin.tie(0);cout.tie(0);
        int x;
        cin>>x;
        cout<<max(x,0);

        }

#include <iostream>
using namespace std;

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


#include <bits/stdc++.h>

using namespace std;

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

#define eps 1e-9
#define INF 2000000000              // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))

#ifndef LOCAL
#define dmp(...) ;
#else
#define dmp(...)                                                               \
  cerr << "[ " << #__VA_ARGS__ << " ] : " << dump_str(__VA_ARGS__) << endl
#endif

// ---------------- Utility ------------------

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

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;

template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

// ----------------- Input -------------------

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

template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}

// ----------------- Output ------------------

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

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

template <class T>
ostream &operator<<(ostream &os, const deque<T> &d) {
  for (const T &e : d) os << e << " ";
  return os;
}

template <class T>
ostream &operator<<(ostream &os, const set<T> &s) {
  os << "{ ";
  for (const T &e : s) os << e << " ";
  os << "}";
  return os;
}

template <class T>
ostream &operator<<(ostream &os, const multiset<T> &s) {
  os << "{ ";
  for (const T &e : s) os << e << " ";
  os << "}";
  return os;
}

template <class T, class U>
ostream &operator<<(ostream &os, const map<T, U> &m) {
  os << "{ ";
  for (const auto &[key, val] : m) os << "( " << key << " -> " << val << " ) ";
  os << "}";
  return os;
}

void dump_str_rec(ostringstream &) {}

template <class Head, class... Tail>
void dump_str_rec(ostringstream &oss, Head &&head, Tail &&... tail) {
  oss << ", " << head;
  dump_str_rec(oss, forward<Tail>(tail)...);
}

template <class T, class... U>
string dump_str(T &&arg, U &&... args) {
  ostringstream oss;
  oss << arg;
  dump_str_rec(oss, forward<T>(args)...);
  return oss.str();
}

// --------------- Fast I/O ------------------

void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

// ------------ End of template --------------

#define endl "\n"

void solve() {
  int N;
  ll X;
  cin >> N >> X;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) { cin >> A[i]; }
  vector<ll> num(N);
  ll tmp = X;
  for (int i = N - 1; i >= 0; i--) {
    num[i] = tmp / A[i];
    tmp %= A[i];
  }
  auto dp = vect(N, vect(2, 0ll));
  dp[0][0] = 1ll;
  for (int i = 0; i + 1 < N; i++) {
    for (int j = 0; j < 2; j++) {
      if (num[i] + j < A[i + 1] / A[i]) dp[i + 1][0] += dp[i][j];
      if (num[i] + j != 0) { dp[i + 1][1] += dp[i][j]; }
    }
  }
  for (int i = 0; i < N; i++) { dmp(dp[i]); }
  cout << dp[N - 1][1] + dp[N - 1][0] << endl;
  return;
}

int main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();

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

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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _lint = int;
#define REP(i, n) for (_lint i = 0; i < (_lint)(n); i++)
#define FOR(i, a, b) for (_lint i = (_lint)(a); i < (_lint)(b); i++)
#define FORR(i, a, b) for (_lint i = (_lint)(b)-1; i >= (_lint)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))
#define ALL(v) (v).begin(), (v).end()

#define DEBUG(x) cerr << #x << ": " << (x) << endl
#define DEBUG_VEC(v)                                                           \
  {                                                                            \
    cerr << #v << ": ";                                                        \
    REP(__i, size(v)) cerr << ((v)[__i]) << ", ";                              \
    cerr << endl;                                                              \
  }

bool mulge(ll a, ll b, ll t) {
  // a * b >= t
  // a >= ceil(t/b)
  return a >= (t + b - 1) / b;
}

int main() {
  ll x, y, a, b;
  cin >> x >> y >> a >> b;
  ll ex = 0;
  ll st = x;
  while (true) {
    if (mulge(st, a, y)) {
      if (st + b >= y) {
        break;
      } else {
        ll rest = y - st - 1;
        ex += rest / b;
        break;
      }
    } else {
      if (st + b >= y) {
        st *= a;
        ex++;
      } else {
        if (st * a < st + b) {
          st *= a;
          ex++;
        } else {
          ll rest = y - st - 1;
          ex += rest / b;
          break;
        }
      }
    }
  }
  cout << ex << endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,0,-1}, dy[4]={1,0,-1,0};
long double eps = 1e-9;
long double pi = acos(-1);

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

	string s[3];
	for(int i=0;i<3;i++)cin>>s[i];
	vector<int> v(10);
	for(int i=0;i<10;i++)v[i] = i;
	int cnt[333]={};
	for(int i=0;i<333;i++)cnt[i]=-1;
	int now = 0;
	for(int i=0;i<3;i++){
		int m = s[i].size();
		for(int j=0;j<m;j++){
			if(cnt[s[i][j]] == -1){
				cnt[s[i][j]] = now;
				now++;
			}
		}
	}
	do{
		ll a[3] = {};
		bool pos = 1;
		for(int i=0;i<3;i++){
			int m = s[i].size();
			if(v[cnt[s[i][0]]] == 0){
				pos=false;
				break;
			}
			for(int j=0;j<m;j++){
				a[i] *= 10;
				a[i] += v[cnt[s[i][j]]];
			}
		}
		if(pos==false)continue;
		if(a[0]+a[1] == a[2]){
			for(int j=0;j<3;j++){
				cout << a[j] << "\n";
			}
			return 0;
		}
	}while(next_permutation(all(v)));
	cout << "UNSOLVABLE" << endl;
}

#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

const int N = 2e5+10;
int n,m,a[N],b[N];

inline void GG(){
	puts("No");exit(0);
}

int fa[N];
ll s[N],S[N];
inline int Find(int x){
	return fa[x]==x?x:fa[x]=Find(fa[x]);
}

int main(){
	n=read(),m=read();
	For(i,1,n) fa[i]=i;
	For(i,1,n) a[i]=read();
	For(i,1,n) b[i]=read();
	For(i,1,m){
		int x=read(),y=read();
		fa[Find(x)]=Find(y);
	}
	For(i,1,n) s[Find(i)]+=a[i],S[Find(i)]+=b[i];
	For(i,1,n) if (Find(i)==i){
		if (s[i]!=S[i]) GG();
	}
	puts("Yes");
}


#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b;
    cin >> a >> b;
    double ret = 100 - 1.0 * b / a * 100;
    printf("%.10f",ret);

    return 0;
}

#include <bits/stdc++.h>

#define N 1000000
#define MAX 1000000000
#define E 0.00000001
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define LEFT(x) (2 * x)
#define RIGHT(x) (2 * x + 1)
#define PAR 0
#define IMPAR 1

using namespace std;

long long pf[N+1];
bool radical[N+1];

void solve(){

	int l, r; cin >> l >> r;

	memset(radical, true, sizeof(radical));

	long long ans = 0;
	for (long long i = 2; i <= r; i++) {

		if (pf[i] == 0) {
			for (long long j = i; j <= r; j += i) {
				pf[j]++;
			}
			for (long long j = i*i; j <= r; j += i*i) {
				radical[j] = false;
			}
		}

		long long cur = (r/i) - ((l-1)/i);

		if (radical[i]) {
			if (pf[i]%2) ans += cur * (cur - 1);
			else ans -= cur * (cur - 1);
		}
	}

	for (int i = max(l, 2); i <= r; i++) {
		ans -= (r-i)/i*2;
	}

	cout << ans << endl;

}

int main(){

	solve();

	return 0;
}


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

typedef long long ll;

int main(){
    // #define LOCAL
#ifdef LOCAL
    freopen("in.in", "r", stdin);
    freopen("out.out", "w", stdout);
#endif
    int n; scanf("%d", &n);
    ll x = 1;
    for(int i = 2; i <= n; ++i){
        ll gcd = __gcd(x, 1ll * i);
        ll m = i / gcd;
        x *= m;
    }
    cout << x + 1 << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;
const double PI = 3.14159265358979;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};

// 最大公約数
ll gcd(ll m, ll n) {
  if (n==0) return abs(m);
  else return gcd(n, m%n);
}

// 最小公倍数
ll lcm(ll m, ll n) {
  return abs(m)/gcd(m, n)*abs(n);
}

int main() {
  ll N;
  cin >> N;
  if (N==2) cout << 3 << endl;
  else {
    ll res = lcm(2, 3);
    for (int i=4; i<=N; i++) res = lcm(res, i);
    res++;
    cout << res << endl;
  }
  return 0;
}


#include <stdio.h>
#include <algorithm>
#include <string.h>
#define int long long
#define N 100005
using namespace std;
typedef long long ll;
const signed mo=1e9+7;
const int INF=0x3f3f3f3f;
inline int read(){
	char ch=getchar();int x=0, f=1;
	while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
int n, a[N], ans, dp[N][2], cnt[N][2];
int mul(int a, int b){
	int ret=0, tmp=a;
	for(; b; b>>=1, tmp=(tmp+tmp)%mo)
		if(b&1) ret=(ret+tmp)%mo;
	return ret;
}
int add(int x, int y){return (x+y)%mo;}
int mus(int x, int y){return ((x-y)%mo+mo)%mo;}
signed main(){
	n=read();
	for(int i=1; i<=n; i++)
		a[i]=read()%mo;
	dp[1][0]=a[1], dp[1][1]=0;
	dp[2][0]=add(a[1], a[2]), dp[2][1]=mus(a[1], a[2]);
	cnt[2][0]=cnt[2][1]=1;
	for(int i=3; i<=n; i++){
		cnt[i][0]=add(cnt[i-1][0], cnt[i-1][1]);
		cnt[i][1]=cnt[i-1][0];
		dp[i][0]=add(add(dp[i-1][0], dp[i-1][1]), mul(cnt[i][0], a[i]));
		dp[i][1]=mus(dp[i-1][0], mul(cnt[i][1], a[i]));
	}
	ans=add(dp[n][0], dp[n][1]);
	printf("%lld", (ans%mo+mo)%mo);
	return 0;
}
/*
5
1 2 3 4 5
 + + + +
 - + + +
 + - + +
 + + - +
 + + + -
 + - + -
 - + - +
 - + + -
 5 6 6 5
 3 2 2 3

 2 4 4 2

*/


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
int n;char s[110];
int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	int l=1;bool flag=false;
	for(int i=n;i>=l;i--)
	{
		if(!flag&&s[i]=='0')
			continue;
		if(s[i]!='0')
			flag=true;
		if(s[l]!=s[i])
		{
			printf("No");
			return 0;
		}
		l++;
	}
	printf("Yes");
}

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

int main()
{
    int a[4];
    for(int i = 0; i < 4; i++) cin >> a[i];
    sort(a, a + 4);
    if(a[0] + a[3] == a[1] + a[2] || a[0] + a[1] + a[2] == a[3]) cout << "Yes" << endl;
    else cout << "No" << endl;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long

set<ll> st;

void count(ll N) {

	int k = (ll)sqrt(N);
	for(int i = 1; i<=k; i++) {
		if(N%i == 0){
		  st.insert(i);
		  st.insert(N/i);
		}
	}
}

int main(void) {

	long long N;
	cin >> N;
	count(N);
	for(auto i : st) {
		cout << i << '\n';
	}

	return 0;
}

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

#define  int               long long int
#define  ld                long double
#define  f(i,j,n)            for(int i = j; i <= n; i++)
#define  r(i,n,j)           for(int i = n; i >= j; i--)
#define  all(container)       container.begin() , container.end()
#define  sz(container)        (int)container.size()
#define  ff                first
#define  ss                second
#define  pii               pair <int , int>
#define  sp(x)              setprecision(x)
#define  mod              1000000007
#define  endl            "\n"
#define  pb              push_back
#define  mp             make_pair
#define  T             int ttt; cin >> ttt; while(ttt--)
#define fast           ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);

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

int32_t main()
{
    fast
    int n;  cin>>n;
    vector<int>v;
    for(int i=1;i<=sqrt(n);i++){
        if(n%i==0)
        {
            v.pb(i);
            if(i*i!=n)  v.pb(n/i);
        }
    }
    if(sz(v)==0){
        v.pb(n);
        v.pb(1LL);
    }
    sort(all(v));
    f(i,0,sz(v)-1)
        cout<<v[i]<<endl;
}


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

#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;++i)
#define per(i,a,b) for(int i=(a),i##end=(b);i>=i##end;--i)
//mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template<typename T>void chkmax(T&x,T y){if(x<y)x=y;}
template<typename T>void chkmin(T&x,T y){if(x>y)x=y;}
inline int read(){
  #define nc getchar()
  bool f=0;int x=0;char c=nc;
  while(c<48)f|=c=='-',c=nc;
  while(c>47)x=x*10+(c^48),c=nc;
  return f?-x:x;
  #undef nc
}

typedef double db;
typedef long long ll;
typedef vector<int>vi;
typedef pair<int,int>pii;
const int maxn=1e5+10;
int n,dp[maxn];char S[maxn];int tmp[26];

void solve(){
  scanf("%d%s",&n,S+1);
  memset(tmp,0x3f,sizeof tmp);
  dp[0]=0;
  tmp[S[1]-'a']=0;
  rep(i,1,n){
    dp[i]=n+1;
    rep(j,0,25)if('a'+j!=S[i]){
      chkmin(dp[i],tmp[j]+1);
    }
    if(i<n)chkmin(tmp[S[i+1]-'a'],dp[i]);
  }
  printf("%d\n",dp[n]>n?-1:dp[n]);
}

signed main(){
//  int T=read();
//  while(T--)solve();
  solve();
  return 0;
}

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

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

    if(s[0]!= s[n-1])
    cout<<1<<"\n";
    else
    {
        bool fg=0;
        for(int i=n-2;i>=0;i--)
        {
            if(s[0]!= s[i] && s[i+1] != s[n-1])
            fg =1;
        }
        if(fg)
        cout<<2<<"\n";
        else
        cout<<-1<<"\n";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
	int n, nn; cin >> n; nn = 1 << n;
	cout << nn-1 << "\n";
	for(int bt=1; bt<nn; bt++){
		rep(i,nn) cout << (char)(__builtin_parity(bt&i) + 'A');
		cout << "\n";
	}
}

#include <bits/stdc++.h>

using namespace std;

// figure out n and m by double counting partnerships
// solved the n = 2 case
// tried natural ways to extend a solution on n to 2n
//  => how to "borrow" structure from the n solution
//  => make a copy of each vertex, how do you link them together
//  => link 1-2 of each team?
//  => link some alternating variant of each team?
//  => i knew i needed to do Two Things, then one more teaming to balance it
//
//  => link 1-2 was natural so that was a good first tep
//  => then i noticed that in all subsequent pairings, i need to not have a 1-2 pair
//  => how do i pair the rest? had the idea of the separate sets of {1, 2} in my head
//  => the next natural thing to do is to take 1 from another team and take 2 from the other team
//  => as a way to still borrow the structure of the n solution
//  => we have to do One operation now, which shouldn't rely on the n solution
//  => a quick check tells us the last team should be all 1s and all 2s
//  which works!

int main() {
    int n; scanf("%d", &n);
    vector<vector<bool>> solution{{true, false}};
    for (int i = 2, sz = 2; i <= n; ++i, sz *= 2) {
        // sz is size of a team
        vector<vector<bool>> ns(2 * solution.size() + 1, vector<bool>(sz * 2));
        for (int g = 0; g < solution.size(); ++g) {
            for (int i = 0; i < sz * 2; ++i) if (solution[g][i % sz]) ns[g][i] = true;
        }
        for (int g = 0; g < solution.size(); ++g) {
            for (int i = 0; i < sz * 2; ++i)
                if ((i < sz && solution[g][i]) || (i >= sz && !solution[g][i - sz])) ns[g + solution.size()][i] = true;
        }
        for (int i = 0; i < sz; ++i) ns.back()[i] = true;
        solution = ns;
    }
    printf("%lu\n", solution.size());
    for (auto &s : solution) {
        for (bool b : s) printf("%c", b ? 'A' : 'B');
        printf("\n");
    }
    return 0;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define mes(a,b) memset((a),(b),sizeof((a)))
#define syio std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
#define lson l, mid, rt << 1
#define rson mid+1, r, rt << 1 | 1
#define lowbit(a) ((a)&-(a))
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
typedef long long ll;
typedef long double real;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const double pi = acos(-1.0);
const double eps = 1e-14;
const int mxn = 100033;
const int mod = 1e9 + 7;//998244353
inline int read(){
    int x = 0,f = 1;char c = getchar();
    while(!isdigit(c))f = c == '-' ? -1 : 1,c = getchar();
    while(isdigit(c))x = x * 10 + c - '0',c = getchar();
    return x * f;
}
inline ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll ksm(ll a,ll b,ll mod){ll ans=1;while(b){if(b&1) ans=(ans*a)%mod;a=(a*a)%mod;b>>=1;}return ans;}
ll inv2(ll a,ll mod){return ksm(a,mod-2,mod);}
void exgcd(ll a,ll b,ll &x,ll &y,ll &d){if(!b) {d = a;x = 1;y=0;}else{exgcd(b,a%b,y,x,d);y-=x*(a/b);}}//printf("%lld*a + %lld*b = %lld\n", x, y, d);
int dx[] = {0 , 1, 0 , -1};
int dy[] = {1 , 0, -1 , 0};
long double x, y, r;
int main()
{
    syio;
    cin>>x>>y>>r;
    r += eps;
    double lx = x - r, rx = x + r;
    ll res = 0;
    for (int i = ceil(lx); i <= floor(rx); ++ i)
    {
        ll t = floor(y + sqrt(r*r - (x - i)*(x - i)));
        ll b = ceil(y - sqrt(r*r - (x - i)*(x - i)));
        res += t - b + 1;
    }
    cout<<res<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
// #define LOCAL // 提出時はコメントアウト
#define DEBUG_

typedef long long ll;
const double EPS = 0.1;
const ll INF = ((1LL<<62)-(1LL<<31));
typedef vector<ll> vecl;
typedef pair<ll, ll> pairl;
template<typename T> using uset = unordered_set<T>;
template<typename T, typename U> using mapv = map<T,vector<U>>;
template<typename T, typename U> using umap = unordered_map<T,U>;

#define ALL(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define sz(x) (ll)x.size()
ll llceil(ll a,ll b) { return (a+b-1)/b; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> vector<vector<T>> genarr(ll n, ll m, T init) { return vector<vector<T>>(n,vector<T>(m,init)); }

///// DEBUG
#define DUMPOUT cerr
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
template<typename T>istream&operator>>(istream&is,vector<T>&vec){for(T&x:vec)is>>x;return is;}
template<typename T,typename U>ostream&operator<<(ostream&os,pair<T,U>&pair_var){os<<"("<<pair_var.first<<", "<<pair_var.second<<")";return os;}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&vec){os<<"{";for(int i=0;i<vec.size();i++){os<<vec[i]<<(i+1==vec.size()?"":", ");}
os<<"}";return os;}
template<typename T,typename U>ostream&operator<<(ostream&os,map<T,U>&map_var){os<<"{";repi(itr,map_var){os<<*itr;itr++;if(itr!=map_var.end())os<<", ";itr--;}
os<<"}";return os;}
template<typename T>ostream&operator<<(ostream&os,set<T>&set_var){os<<"{";repi(itr,set_var){os<<*itr;itr++;if(itr!=set_var.end())os<<", ";itr--;}
os<<"}";return os;}
void dump_func(){DUMPOUT<<endl;}
template<class Head,class...Tail>void dump_func(Head&&head,Tail&&...tail){DUMPOUT<<head;if(sizeof...(Tail)>0){DUMPOUT<<", ";}
dump_func(std::move(tail)...);}
#ifndef LOCAL
#undef DEBUG_
#endif
#ifdef DEBUG_
#define DEB
#define dump(...)                                                          \
DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
        << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
        << endl                                                            \
        << "    ",                                                         \
    dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

//////////

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

int solve(ostringstream &cout) {
    #ifdef LOCAL
    ifstream in("../../Atcoder/input.txt");
    cin.rdbuf(in.rdbuf());
    #endif

    ll N;
    cin>>N;

    vector<pair<double,double>> P;
    rep(i,N) {
        ll t,_l,_r;
        cin>>t>>_l>>_r;
        double l = _l, r = _r;
        // [l,r]
        if (t == 1) {

        }
        else if (t == 2) {
            r-=EPS;
        }
        else if (t == 3) {
            l+=EPS;
        }
        else {
            l+=EPS,r-=EPS;
        }

        P.emplace_back(l,r);
        dump(l,r);
    }

    ll ans = 0;
    rep(i,N) {
        REP(j,i+1,N) {
            auto [l1,r1] = P[i];
            auto [l2,r2] = P[j];
            // cout << fixed << setprecision(12) << r2 << endl;
            bool over = !(r1 < l2 || r2 < l1);
            dump(i,j,over);
            ans += over;
        }
    }

    cout << ans << endl;

    return 0;
}

int main() {
    ostringstream oss;
    int res = solve(oss);

    cout << oss.str();
    return res;
}


    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    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; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P=pair<ll,ll>;
    const int INF=1001001001;
    const int mod=1e9+7;

    int main(){
        int n;
        cin>>n;
        vector<int>p(n);
        rep(i,n){
            cin>>p[i];
            p[i]--;
        }
        int i=0;
        vector<int>res;
        while(i<n-1){
            int j=i;
            while(j<n&&i!=p[j]){
                j++;
            }
            if(j!=n-1&&j==i){
                cout<<-1<<endl;
                return 0;
            }
            if(j==n){
                cout<<-1<<endl;
                return 0;
            }
            for(int k=j;k>i;k--){
                res.push_back(k);
                swap(p[k],p[k-1]);
            }
            i=j;
        }
        rep(i,n){
            if(p[i]!=i){
                cout<<-1<<endl;
                return 0;
            }
        }
        rep(i,res.size()){
            cout<<res[i]<<endl;
        }
        return 0;
    }

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

using namespace __gnu_pbds;
using namespace std;

#define int             long long
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define sz(x)           (int)(x.size())
#define CR(x,n)          x.clear();x.resize(n)
#define all(x)          x.begin(),x.end()
#define repf(i,s,e)     for(int i=s;i<e;i++)
#define AUTO(c,v)         for(auto c:v)

template<typename T, typename T1>T smax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T smin(T &a, T1 b) {if (b < a)a = b; return a;}

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

#define nl '\n'
template <typename T, size_t N>
int SIZE(const T (&t)[N]) {
	return N;
}

template<typename T>
int SIZE(const T &t) {
	return t.size();
}

string to_string(const string s, int x1 = 0, int x2 = 1e9) {
	return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"';
}

string to_string(const char* s) {
	return to_string((string) s);
}

string to_string(const bool b) {
	return (b ? "true" : "false");
}

string to_string(const char c) {
	return string({c});
}

template<size_t N>
string to_string(const bitset<N> &b, int x1 = 0, int x2 = 1e9) {
	string t = "";
	for (int __iii__ = min(x1, SIZE(b)),  __jjj__ = min(x2, SIZE(b) - 1); __iii__ <= __jjj__; ++__iii__) {
		t += b[__iii__] + '0';
	}
	return '"' + t + '"';
}

template <typename A, typename... C>
string to_string(const A (&v), int x1 = 0, int x2 = 1e9, C... coords);

int l_v_l_v_l = 0, t_a_b_s = 0;

template <typename A, typename B>
string to_string(const pair<A, B> &p) {
	l_v_l_v_l++;
	string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
	l_v_l_v_l--;
	return res;
}

template <typename A, typename... C>
string to_string(const A (&v), int x1, int x2, C... coords) {
	int rnk = rank<A>::value;
	string tab(t_a_b_s, ' ');
	string res = "";
	bool first = true;
	if (l_v_l_v_l == 0) res += nl;
	res += tab + "[";
	x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
	auto l = begin(v);
	advance(l, x1);
	auto r = l;
	advance(r, (x2 - x1) + (x2 < SIZE(v)));
	for (auto e = l; e != r; e = next(e)) {
		if (!first) {
			res += ", ";
		}
		first = false;
		l_v_l_v_l++;
		if (e != l) {
			if (rnk > 1) {
				res += nl;
				t_a_b_s = l_v_l_v_l;
			};
		}
		else {
			t_a_b_s = 0;
		}
		res += to_string(*e, coords...);
		l_v_l_v_l--;
	}
	res += "]";
	if (l_v_l_v_l == 0) res += nl;
	return res;
}

void dbg() {;}
template<typename Heads, typename... Tails>
void dbg(Heads H, Tails... T) {
	cout << to_string(H) << " | ";
	dbg(T...);
}
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; dbg(__VA_ARGS__); cout << endl;

/* read */
template<typename... T>
void read(T&...args) {
	((cin >> args), ...);
}
template<class T>
void readArray(vector<T>& arr) {
	for (auto& c : arr) cin >> c;
}
/* print */
template<typename...T>
void print(T...args) {
	((cout << args << " "), ...);
	cout << nl;
}
template<class T>
void printArray(vector<T>& arr) {
	AUTO(c, arr) cout << c << " ";
	cout << nl;
}

const int INF = 1e18;

void solve() {
	int m, h;
	read(m, h);
	if (h % m == 0) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
}

int32_t main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	// if(fopen("input.txt", "r")){
	//     freopen("input.txt", "r", stdin),
	//     freopen("output.txt", "w", stdout);
	// }

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


#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

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

int main(){
    int n;
    cin >> n;
    int m = (1<<n);
    vector<string> res;
    rep(bits,1<<n){
        if(bits==0)continue;
        vector<bool> flag(m);
        rep(i,m){
            int c = 0;
            rep(j,n){
                if((bits>>j)&1){
                    if((i>>j)&1)c++;
                }
            }
            if(c%2==1)flag[i] = 1;
        }
        string s;
        rep(i,m){
            if(flag[i]){
                s.push_back('A');
            }else{
                s.push_back('B');
            }
        }
        res.push_back(s);
    }
    cout << res.size() << "\n";
    for(auto x:res){
        cout << x << "\n";
    }
    return 0;
}

#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 100005;
const int mod = 1000000007;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  ll n;
  unordered_map<ll, int>st;
  ll cur = 5;
  cin>>n;
  int cnt = 1;
  while(cur<=n){
    st[cur] = cnt;
    cur*=5;
    cnt++;
  }
  int cnt2 = 1;
  cur = 3;
  while(cur<n){
    if(st.find(n-cur)!=st.end()){
      cout<<cnt2<<" "<<st[n-cur]<<endl;
      return 0;
    }
    cur *=3;
    cnt2++;
  }
  cout<<-1<<endl;
  return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef long long ll;

#define f first
#define s second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

const int md = 3;
const ll inf = 1e18;
const int maxn = 4e5+5;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

char st[maxn];

void add(int &a, int b)
{
	a += b;
	if(a>= md)
	{
		a -= md;
	}
}

int mul(int a, int b)
{
	return (1LL*a*b)%md;
}

vector<int> get3(int x)
{
	vector<int> res;
	while(x)
	{
		res.pb(x%3);
		x /= 3;
	}
	return res;
}

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

	vi base = get3(n-1);
	int res = 0;
	for(int i = 0; i< n; i++)
	{
		int val = 0;
		if(st[i] == 'W') val = 1;
		else if(st[i] == 'R') val = 2;
		vi x = get3(i);

		int nck = 1;

		for(int j = 0; j< min((int) x.size(), (int) base.size()); j++)
		{
			int a = base[j], b = x[j];
			int fac = 0;
			if(a< b) fac = 0;
			else if(a == b || b == 0) fac = 1;
			else fac = 2;
			nck = (nck*fac)%3;
		}

		add(res, mul(val, nck));
	}
	if(n%2 == 0) res = -res;
	res %= 3;
	if(res< 0) res += 3;
	if(res == 0) puts("B");
	else if(res == 1) puts("W");
	else puts("R");
}

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

using namespace std;

// using mint = long double;
// using mint = modint998244353;
// using mint = modint1000000007;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<ll, vector<ll>> Pd;

const ll INF = 4e18;
const ll fact_table = 3200008;

priority_queue<ll> pql;
priority_queue<P> pqp;
// big priority queue
priority_queue<ll, vector<ll>, greater<ll>> pqls;
priority_queue<P, vector<P>, greater<P>> pqps;
// small priority queue
// top pop

ll dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
ll dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
//↓,→,↑,←

/*
#define endl "\n"
#ifdef ENJAPMA
#undef endl
#endif
*/

#define p(x) cout << x << endl;
#define el cout << endl;
#define pe(x) cout << x << " ";
#define ps(x) cout << fixed << setprecision(25) << x << endl;
#define pu(x) cout << (x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pc(x) cout << x << ",";
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = a; i <= (b); i++)
#define rep3(i, a, b) for (ll i = a; i >= (b); i--)
#define all(c) begin(c), end(c)

typedef vector<ll> vec;
typedef vector<vector<ll>> mat;

// vec v(n) -> 長さnのベクトルを宣言
// mat dp(h, vec(w)) -> h * w の行列を宣言

// const ll mod = 998244353ll;
const ll mod = 3ll;

ll mypow(ll a, ll b, ll m = mod) {
    ll x = 1;
    while (b) {
        while (!(b & 1)) {
            (a *= a) %= m;
            b >>= 1;
        }
        (x *= a) %= m;
        b--;
    }
    return x;
}
vec rv(ll read) {
    vec res(read);
    for (int i = 0; i < read; i++) {
        cin >> res[i];
    }
    return res;
}
/*
ll fact[fact_table + 5], rfact[fact_table + 5];

void c3_init() {
    fact[0] = rfact[0] = 1;
    for (ll i = 1; i <= fact_table; i++) {
        fact[i] = (fact[i - 1] * i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table], mod - 2, mod);
    for (ll i = fact_table; i >= 1; i--) {
        rfact[i - 1] = rfact[i] * i;
        rfact[i - 1] %= mod;
    }
    return;
}
ll c3(ll n, ll r) {
    return (((fact[n] * rfact[r]) % mod) * rfact[n - r]) % mod;
}
*/
bool icpc = false;
bool multicase = false;

// 配列の長さ、取り間違えてない？
ll n;
string s;
ll dp[10][10];

ll cc3(ll m, ll n) {
    ll value = 1ll;
    for (int i = 0; i < 100; i++) {
        ll mi = m % 3, ni = n % 3;
        value *= dp[mi][ni];
        value %= 3;
        m /= 3ll;
        n /= 3ll;
    }
    return value;
}

bool solve() {
    cin >> n;
    cin >> s;
    dp[0][0] = 1, dp[0][1] = 0, dp[0][2] = 0;
    dp[1][0] = 1, dp[1][1] = 1, dp[1][2] = 0;
    dp[2][0] = 1, dp[2][1] = 2, dp[2][2] = 1;
    ll sum = 0;
    ll c3 = 1ll;
    rep(i, n) {
        ll value = 0;
        if (s[i] == 'B') value = 1;
        if (s[i] == 'W') value = 2;
        sum += value * cc3(n - 1, i);
    }

    sum %= 3;
    if ((n - 1) % 2 == 1) {
        sum = (3 - sum) % 3;
    }
    vector<char> ans = {'R', 'B', 'W'};
    p(ans[sum % 3]);
    return true;
}

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

    if (icpc) {
        while (solve())
            ;
        return 0;
    }
    ll q, testcase = 1;
    if (multicase) {
        cin >> q;
    } else {
        q = 1;
    }
    while (q--) {
        // cout << "Case #" << testcase << ": ";
        solve();
        testcase++;
    }

    // solve();
    return 0;
}