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

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
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;}
//-------------------------------------------------------

int N;
int A[402020];

ll mo=3;

ll fact[403030];
ll fact3[403030];

ll modpow(ll a, ll n=mo-2) {
	ll r=1;
	while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1;
	return r;
}

ll comb(int A,int B) {
	int C=A-B;

	if(fact3[A]>fact3[B]+fact3[C]) return 0;
	return fact[A]*modpow(fact[B]*fact[C])%mo;

}

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

	cin>>N;

	fact[0]=1;
	fact3[0]=0;
	for(i=1;i<=N-1;i++) {
		fact[i]=fact[i-1];
		fact3[i]=fact3[i-1];
		x=i;
		while(x%3==0) {
			fact3[i]++;
			x/=3;
		}
		fact[i]=fact[i]*x%3;
	}

	cin>>s;
	ll ret=0;
	FOR(i,N) {
		if(s[i]=='B') A[i]=0;
		if(s[i]=='W') A[i]=1;
		if(s[i]=='R') A[i]=2;

		if(N%2==1) {
			ret+=comb(N-1,i)*A[i];
		}
		else {
			ret-=comb(N-1,i)*A[i];
		}

	}
	ret=(ret%3+3)%3;
	cout<<"BWR"[ret]<<endl;

}

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

#include<bits/stdc++.h>
using namespace std;
const int N=400005;
int n,a[N],f[]={1,1,2},sum;
char s[N];
int c(int n,int m)
{
	if(n<m) return 0;
	if(n<3) return f[n]*f[m]*f[n-m]%3;
	return c(n%3,m%3)*c(n/3,m/3)%3;
}
int main()
{
	scanf("%d%s",&n,s+1);
	for(int i=1;i<=n;i++)
		if(s[i]=='W') a[i]=1;
		else if(s[i]=='R') a[i]=2;
	for(int i=1;i<=n;i++) sum=(sum+a[i]*c(n-1,i-1))%3;
	if(n%2==0) sum=(3-sum)%3;
	if(sum==0) puts("B");
	if(sum==1) puts("W");
	if(sum==2) puts("R");
	return 0;
}


#include <cmath>
#include <algorithm>
#include <bitset>
#include <iostream>
#include <set>
#include <string>
#include <tuple>
#include <unordered_set>
#include <vector>
using namespace std;

int main()
{
  ios_base::sync_with_stdio(false);

  string input;
  cin >> input;

  auto sub = input;
  size_t itr = 0;
  int count = 0;
  for (size_t i = 0; i < input.length(); i++)
  {
    if (sub.find("ZONe") == string::npos)
      break;

    count++;
    itr = sub.find("ZONe");
    if (itr > input.length() - 4)
      continue;
    sub = sub.substr(itr + 4);
  }

  cout << count << endl;

  return 0;
}

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <cmath>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef pair<int,int> pii;
typedef pair<long long, int> pli;
typedef pair<int, long long> pil;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n)-1;i >= 0;i--)
#define repr(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) (x).size()

constexpr ll mod = 998244353;

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

ll inv(ll x){
    ll res = 1;
    ll k = mod - 2;
    ll y = x;
    while(k){
        if(k&1)res = (res*y)%mod;
        y = (y*y) % mod;
        k /= 2;
    }
    return res;
}

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

    string s;
    cin >> s;
    string ret = "Yes";
    rep(i,s.length()) {
        if (s[i] >= 'a' && s[i] <= 'z') {
            if (i % 2 != 0) ret = "No";
        } else {
            if (i % 2 != 1) ret = "No";
        }
    }
    cout << ret << endl;
}


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

int main() {
  int l;
  cin >> l;
  ll ans = 1;
  for (int i = 1; i <= 11; i++) {
    ans*= l - i;
    ans/= i;
  }
  cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using tlll = tuple<ll, ll, ll>;
//constexpr ll MOD = 1e9 + 7;
constexpr ll MOD = 998244353;
//constexpr ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
constexpr ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
#define FINALANS(A) do {cout << (A) << '\n'; exit(0);} while (false)

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

  const ll M = 210;
  vector<vector<ll>> C(M, vector<ll>(M, 0));
  C.at(0).at(0) = 1;
  for (ll i = 0; i < M - 1; i++)
  {
    for (ll j = 0; j < i + 1; j++)
    {
      C.at(i + 1).at(j) += C.at(i).at(j);
      C.at(i + 1).at(j + 1) += C.at(i).at(j);
    }
  }

  /*
  for (ll i = 0; i < M; i++)
  {
    for (ll j = 0; j < M; j++)
    {
      cerr << C.at(i).at(j) << " ";
    }
    cerr << endl;
  }
  //*/

  ll ans = C.at(L - 1).at(11);
  cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<endl
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

vector<string> C(vector<string> s) {
  ll n=s.size();
  rep(i,n)REP(j,i+1,n) swap(s[i][j],s[j][i]);
  return s;
}

ll n,m;
string s[1000];

ll calc(vector<string> t) {
  ll cnt=0;
  rep(k,m) {
    ll f=0;
    rep(l,2) {
      rep(i,n) {
        rep(j,n) {
          if(t[i].substr(0,s[k].size())==s[k]) f=1;
          rotate(t[i].begin(),t[i].begin()+1,t[i].end());
        }
      }
      t=C(t);
    }
    cnt+=f;
  }
  return cnt;
}

vector<string> ans;
ll MM;

void solve(vector<string> t) {
  ll d=calc(t);
  if(MM<d) {
    MM=d;
    ans=t;
  }
  rep(k,5) {
    random_shuffle(all(t));
    rep(i,n) rotate(t[i].begin(),t[i].begin()+rand()%n,t[i].end());
    ll d=calc(t);
    if(MM<d) {
      MM=d;
      ans=t;
    }
  }
}

void Main() {
  srand((unsigned)time(NULL));
  cin >> n >> m;
  rep(i,m) R s[i];
  vector<string> v[15];
  rep(i,m) v[s[i].size()].pb(s[i]);
  rep(e,35) {
    vector<string> t(n);
    rrep(i,15) {
      random_shuffle(all(v[i]));
      rep(j,v[i].size()) {
        ll M=MAX,x=0;
        string rr;
        rep(k,n) {
          rep(l,t[k].size()+1) {
            string r1=t[k].substr(l);
            if(r1.size()<=v[i][j].size()) {
              string r2=v[i][j].substr(0,r1.size());
              if(r1==r2) {
                ll d=t[k].size()+v[i][j].size()-r1.size();
                if(d<=n&&M>d) {
                  M=d;
                  x=k;
                  rr=t[k]+v[i][j].substr(r1.size());
                }
              }
            }
            if(l+v[i][j].size()<=t[k].size()) {
              r1=t[k].substr(l,v[i][j].size());
              if(r1==v[i][j]) {
                M=0;
                x=k;
                rr=t[k];
              }
            }
          }
        }
        if(rand()%(i+3)==0) M=MAX;
        if(M!=MAX) t[x]=rr;
      }
    }
    rep(i,n) {
      while(t[i].size()<n) {
        //t[i]+='.';
        t[i]+=(char)(rand()%8+'A');
      }
    }
    solve(t);
  }
  rep(i,n) pr(ans[i]);
}

int main(){Main();return 0;}

#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <complex>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
#include <limits>
#include <time.h>
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <limits.h>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define rRep(i,a,b) for(ll i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if (lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if (lhs > rhs) { lhs = rhs; return 1; } return 0; }
template<typename T> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

class DisjointSet{
  public:
    vector<int> rank,p,sz;

    DisjointSet(){}

    //初期化
    DisjointSet(int size){
      rank.resize(size,0);
      p.resize(size,0);
      sz.resize(size,1);
      rep(i,size){
        makeSet(i);
      }
    }
    void makeSet(int x){
      p[x]=x;
      rank[x]=0;
    }

    bool same(int x,int y){
      return findSet(x)==findSet(y);
    }

    void unite(int x,int y){
      if(!same(x,y)) link(findSet(x),findSet(y));
    }

    int size(int key){
      return sz[findSet(key)];
    }

    void link(int x,int y){
      if(rank[x]>rank[y]){
        p[y]=x;
        sz[x]+=sz[y];
      }
      else{
        p[x]=y;
        sz[y]+=sz[x];
        if(rank[x]==rank[y]){
            rank[y]++;
        }
      }
    }

    int findSet(int x){ // 根を返す
      if(x!=p[x]){
        p[x]=findSet(p[x]);
      }
      return  p[x];
    }
};

map<ll,ll> S,T;

int main(){
  ll N,M;
  cin >> N >> M;
  DisjointSet X;
  X=DisjointSet(N+1);  // N頂点(0-indexed)を用意
  vector<ll> A(N),B(N);
  rep(i,N){
    cin >> A[i];
  }
  rep(i,N){
    cin >> B[i];
  }
  rep(i,M){
    ll a,b;cin>>a>>b;a--;b--;
    X.unite(a,b);
  }
  rep(i,N){
    S[X.findSet(i)]+=A[i];
    T[X.findSet(i)]+=B[i];
  }
  for(auto P : S){
    if(S[P.fr]!=T[P.fr]){
      cNo;
      return 0;
    }
  }
  cYes;
}


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

int c[100010], cnt[100010], good[100010];
vector<int> e[100010];

void dfs(int now, int p = -1) {
	if (cnt[c[now]] == 0)
		good[now] = true;
	cnt[c[now]]++;
	for (auto to : e[now]) if (to != p)
		dfs(to, now);
	cnt[c[now]]--;
}

int main() {
	int n; cin >> n;
	REP(i, n) cin >> c[i];
	REP(i, n-1) {
		int a, b; cin >> a >> b;
		e[--a].push_back(--b);
		e[b].push_back(a);
	}
	dfs(0);
	REP(i, n) if (good[i])
		cout << i+1 << '\n';
    return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define SORT(v) sort(all(v))
#define int long long
#define ff first
#define ss second
#define mod 1000000007
#define endl "\n"

using namespace std;

void oj()
{
  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif
}

vector<int>v[200005];
int n;
vector<int>color;
set<int>st;
vector<int>ans;
void dfs(int x, int par)
{
  bool ok = false;
  if(st.find(color[x]) == st.end())
  {
    st.insert(color[x]);
    ans.pb(x);
    ok = true;
  }
  for(auto el : v[x])
  {
    if(el != par)
      dfs(el, x);
  }
  if(ok)
    st.erase(color[x]);
}
void solve()
{
  cin>>n;
  color = vector<int>(n + 1);

  for(int i = 1; i <= n; i++)
    cin>>color[i];

  for(int i = 0; i < n - 1; i++)
  {
    int a, b; cin>>a>>b;
    v[a].pb(b);
    v[b].pb(a);
  }

  dfs(1, 0);
  SORT(ans);
  for(auto el : ans)
    cout<<el<<endl;
}
signed main()
{
  oj();
  // int t; cin>>t;
  // while(t--)
    solve();

  return 0;
}


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

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

int main()
{
	contest();
	fast
	/////   CODE BELOW    //////////

	long long int a, b;
	cin >> a >> b;
	long long int sm = 0;
	long long int sm2 = 0;
	if (a >= b)
	{
		for (int i = 1; i <= a; i++)
		{
			cout << i << " ";
			sm += i;
		}
		for (int i = 1; i <= b - 1; i++)
		{
			cout << (-i) << " ";
			sm2 += i;
		}
		sm2 = -sm2;
		cout << -(sm + sm2);
	}
	else
	{
		for (int i = 1; i <= b; i++)
		{
			cout << (-i) << " ";
			sm2 += i;
		}
		sm2 = -sm2;
		for (int i = 1; i <= a - 1; i++)
		{
			cout << i << " ";
			sm += i;
		}
		cout << -(sm + sm2);
	}
}

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acosl(-1.0);

ll mod_pow(ll x, ll n, ll m = mod) {
	if (n < 0) {
		ll res = mod_pow(x, -n, m);
		return mod_pow(res, m - 2, m);
	}
	if (abs(x) >= m)x %= m;
	if (x < 0)x += m;
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % m;
		x = x * x % m; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 16;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[a - b];
}

void solve() {
	int a, b; cin >> a >> b;
	vector<int> ans;
	bool sw = false;
	if (a < b) {
		sw = true; swap(a, b);
	}
	int sum = 0;
	rep1(i, a) {
		ans.push_back(i);
		sum += i;
	}
	rep1(i, b - 1) {
		ans.push_back(-i);
		sum -= i;
	}
	ans.push_back(-sum);
	if (sw) {
		rep(i, ans.size())ans[i] *= -1;
	}
	rep(i, a + b){
		if (i > 0)cout << " ";
		cout << ans[i];
	}
	cout << "\n";
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(10);
	//init_f();
	//init();
	//expr();
	//int t; cin >> t;rep(i,t)
	//while(cin>>n,n)
	//solve();
	solve();
	return 0;
}


#include<cstdio>
#define F(i,l,r) for(int i=l,i##_end=r;i<i##_end;++i)
using namespace std;
template<typename T>void read(T &x)
{
	bool neg=false;
	unsigned char c=getchar();
	for(;(c^48)>9;c=getchar())if(c=='-')neg=true;
	for(x=0;(c^48)<10;c=getchar())x=(x<<3)+(x<<1)+(c^48);
	if(neg)x=-x;
}
int a,b,c;
int main()
{
	read(a);read(b);read(c);
	puts(a*a+b*b<c*c?"Yes":"No");
	return 0;
}

#define MOD_TYPE 1

#pragma region Macros

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

#if 0
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using Int = boost::multiprecision::cpp_int;
using lld = boost::multiprecision::cpp_dec_float_100;
#endif
#if 0
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

//constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr ll MOD = 3;
constexpr int INF = (int)1e9 + 10;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-9;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define REPI(i, m, n) for (int i = m; i < (int)(n); ++i)
#define repi(i, n) REPI(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

struct io_init
{
  io_init()
  {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(30) << setiosflags(ios::fixed);
  };
} io_init;
template <typename T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
inline ll CEIL(ll a, ll b)
{
  return (a + b - 1) / b;
}
template <typename A, size_t N, typename T>
inline void Fill(A (&array)[N], const T &val)
{
  fill((T *)array, (T *)(array + N), val);
}
template <typename T, typename U>
constexpr istream &operator>>(istream &is, pair<T, U> &p) noexcept
{
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
constexpr ostream &operator<<(ostream &os, pair<T, U> &p) noexcept
{
  os << p.first << " " << p.second;
  return os;
}
#pragma endregion

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

void solve()
{
  ll a, b, c;
  cin >> a >> b >> c;
  Yes(a*a+b*b<c*c);
}

int main()
{
  solve();
}


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

int main() {
  int sum = 0;
  int day = 1;
  int n;
  cin >> n;
  for(int i = 1; i < n; i++) {
    sum += i;
    if(sum >=  n) {
      break;
    }
    day++;
  }
  cout << day << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef map<ll, ll> ml;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {return (a % b + b) % b;}
ll quo(ll a, ll b) {return (a - mod(a, b)) / b;}
template <typename T, typename U> bool chmin(T &a, const U b) {if(a > b) {a = b; return 1;} return 0;}
template <typename T, typename U> bool chmax(T &a, const U b) {if(a < b) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 2e5;
const ld eps = 1e-9;
const char newl = '\n';

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

  ll n;
  string ans;
  cin >> n;
  vl a(2*n);
  rep(i, 2*n) cin >> a[i];
  vpl vec(2*n);
  rep(i, 2*n) vec[i] = pl(a[i], i);
  sort(all(vec));
  vb plus(2*n, 1);
  rep(i, n) plus[vec[i].second] = 0;
  ll cnt = 0;
  rep(i, 2*n) {
    if(plus[i]) {
      if(cnt >= 0) ans += '(';
      else ans += ')';
      cnt++;
    }else {
      if(cnt <= 0) ans += '(';
      else ans += ')';
      cnt--;
    }
  }
  cout << ans << newl;
  return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define reset(a, v) memset((a), v, sizeof(a))

using namespace std;

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

ll x, y, a, b;

bool isOverflow(ll x, ll a) {
	return (ll)1e18/x < a;
}

int main() {
	cin >> x >> y >> a >> b;
	ll ans = 0;
	while (1) {
		// cout << x << "\n";
		// cout << ans << "\n";
		if (isOverflow(x,a) || x*a >= x+b) {
			if (x+b >= y) {
				cout << ans << "\n";
				return 0;
			}
			else {
				ans += (y-x-1)/b;
				cout << ans << "\n";
				return 0;
			}
		}
		else {
			if (x*a >= y) {
				cout << ans << "\n";
				return 0;
			}
			else {
				x *= a;
				ans++;
			}
		}
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define VVEC(type) vector<vector<type>>

ll myproduct(ll x, ll y)
{
    return (__LONG_LONG_MAX__ / x < y) ? __LONG_LONG_MAX__ : x * y;
}

ll mysum(ll x, ll y)
{
    return (__LONG_LONG_MAX__ - x < y) ? __LONG_LONG_MAX__ : x + y;
}

int main()
{
    ll X, Y, A, B;
    INX(X, Y, A, B);

    ll result = 0; //exp
    while(true)
    {
        ll method1 = myproduct(X, A);
        ll method2 = mysum(X, B);

        if(method1 >= Y && method2 >= Y)
        {
            break;
        }
        else if(method1 > method2)
        {
            //continue to choose method2(Atcoder gym)
            result += (Y - X - 1) / B;
            break;
        }
        else
        {
            X = method1;
            result++;
        }
    }
    OUTX(result);

    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

string inv(string s) {
    string res;
    for (auto t : s) {
        if (t == 'A') {
            res.push_back('B');
        } else {
            res.push_back('A');
        }
    }
    return res;
}

vector<string> op(vector<string> a) {
    vector<string> res;
    for (auto t : a) {
        res.push_back(t + t);
    }
    for (auto t : a) {
        res.push_back(t + inv(t));
    }
    string s(a[0].size(), 'A');
    res.push_back(s + inv(s));
    // for (auto t : a) {
    //     res.push_back(inv(t) + t);
    // }
    return res;
}

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

    int k;
    cin >> k;
    if (k == 1) {
        cout << 1 << endl;
        cout << "AB" << endl;
        exit(0);
    }
    vector<string> v = {
        "AABB",
        "ABAB",
        "ABBA"
    };
    for (int i = 2; i < k; i++) {
        v = op(v);
    }
    cout << v.size() << '\n';
    for (auto s : v) {
        cout << s << '\n';
    }
}


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

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

using namespace std;

bool
check(int a, int b, int w, int& min, int& max)
{
	int imin = int(w / b);
	int imax = int(w / a);
	auto diff = float(b - a);
	min = imax;
	max = imin;
	bool is_ok = false;
	for (int i = imin; i <= imax; ++i) {
		for (int j = 0; j <= i; ++j) {
			auto ww = a * j;
			if ((w - ww) <= (i - j) * b) {
				is_ok = true;
				min = std::min(min, i);
				max = std::max(max, i);
				break;
			}
		}
	}

	return is_ok;
}

int
main(void)
{
	int a = 1, b = 2, w = 1;
	cin >> a >> b >> w;
	w = w * 1000;

	int min, max;
	bool is_ok;
	//is_ok = check(100, 200, 2000, min, max);
	//assert(is_ok && min == 10 && max == 20);
	//is_ok = check(120, 150, 2000, min, max);
	//assert(is_ok && min == 14 && max == 16);
	//is_ok = check(300, 333, 1000, min, max);
	//assert(is_ok == false);

	is_ok = check(a, b, w, min, max);

	if (is_ok)
		cout << min << " " << max << endl;
	else
		cout << "UNSATISFIABLE" << endl;

	return 0;
}

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

vector<int> g[200000];
ll A[200000];
ll Max_cost[200000];

ll Find_Max(int u){
    if(Max_cost[u] != -1) return Max_cost[u];

    ll v = 0;
    for(int x:g[u]){
       v =  max({v,A[x],Find_Max(x)});
    }
    Max_cost[u] = v;
    return Max_cost[u];
}

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

    rep(i,N){
        long long v;
        cin >> v;
        A[i] = v;
    }

    rep(i,M){
        int u,v; cin >> u >> v; u--; v--;
        g[u].push_back(v);
    }

    rep(i,N) Max_cost[i] = -1;

    rep(i,N){
        if(Max_cost[i] == -1){
            Find_Max(i);
        }
    }

    ll result = - 1000000001;

    rep(i,N){
        /* cout << Max_cost[i] << endl; */
        if(Max_cost[i] == 0) continue;
        ll c = Max_cost[i] - A[i];
        result = max(result,c);
    }

    cout << result << endl;

    return 0;
}


#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int MOD2 = 998'244'353;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10L;

template<class T, class S> inline bool chmax(T &a, const S &b){
    if(a < b){a = b; return true;}
    return false;
}
template<class T, class S> inline bool chmin(T &a, const S &b){
    if(b < a){a = b; return true;}
    return false;
}
template<class T, class S> inline bool exist(std::set<T> &s, const S &e){
    return (s.find(e) != std::end(s));
}

int main(){
    int L, R; std::cin >> L >> R;

    long long ans{};
    std::vector<long long> cnt(R+1, 0);
    for(int g{R}; g >= 2; --g){
        long long k{R/g - (L-1)/g}, c{k * k};
        for(int i{2*g}; i <= R; i += g){
            c -= cnt[i];
        }
        cnt[g] = c;
        if(std::max(2, L) <= g && g <= R){
            c -= 2 * k - 1;
        }
        ans += c;
    }
    std::cout << ans << std::endl;
    return 0;
}

#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
ll phi[1010000];
void EULERinit()
{
    ll top=1000000;
    for(int i=2;i<=top;++i)phi[i]=i;
    for(int i=2;i<=top;++i)
    {
        if(phi[i]==i)for(int j=i;j<=top;j+=i)phi[j]-=phi[j]/i;
        phi[i]+=phi[i-1];
    }
}

ll f1(ll l,ll r){
    ll ans=0;
        for(int i=l;i<=r;i++){
            for(int j=l;j<=r;j++){
                ll gcd=__gcd(i,j);
                if(gcd!=1&&gcd!=i&&gcd!=j) ans++;
            }
        }return ans;
}

ll f(ll n){
    if(n==0) return 0;
    ll sum=n*n,cnt=0;
    for(ll i=2;i<=n;i++){
        cnt+=(n/i-1)*2+1;
    }
    return sum-cnt-phi[n]*2-1;
}

const int MAXN = 1000000+10;

ll cnt[MAXN];
ll mu[MAXN],prime[MAXN];
ll num[MAXN];
bool vis[MAXN];
int pcnt;

/*求解Mobinus函数*/
void Mobinus()
{
    memset(vis,0,sizeof(vis));
    pcnt=0;
    mu[1]=1;
    for(int i=2;i<MAXN;i++){
        if(!vis[i]){
            prime[pcnt++]=i;
            mu[i]=-1;
        }
        for(int j=0;j<pcnt&&i*prime[j]<MAXN;j++){
            vis[i*prime[j]]=1;
            if(i%prime[j])mu[i*prime[j]]=-mu[i];//i是素数的情况
            else {
                mu[i*prime[j]]=0;
                break;
            }
        }
    }
}

ll Main(ll l,ll r)
{
    Mobinus();
    int n=r-l+1;
    ll Max=-99999999,ans=0;
    ll a[MAXN];
    memset(cnt,0,sizeof(cnt));
    memset(num,0,sizeof(num));
    for(int i=0;i<n;i++){
        a[i]=l+i;
        Max=max(a[i],Max);
    }
    for(int i=0;i<n;i++){
        num[a[i]]++;
    }
    for(int i=1;i<=Max;i++){
        for(int j=i;j<=Max;j+=i)
            cnt[i]+=num[j];
    }
    for(int i=1;i<=Max;i++){
        ans+=(mu[i]*cnt[i]*(cnt[i]-1))>>1;
    }
   return ans;
}

ll ff(ll l,ll r){
    ll sum=(r-l+1)*(r-l+1);
    ll cnt=0;
    for(ll i=max(2LL,l);i<=r;i++){
        cnt+=(r/i-1)*2+1;
    }
    //cout<<sum<<" "<<cnt<<" "<<Main(l,r)<<" "<<phi[r]<<endl;
    if(l>1) return sum-cnt-Main(l,r)*2;
    else return sum-cnt-phi[r]*2-1;
}
int main() {
    ll l,r;
    EULERinit();
    cin>>l>>r;
        //cout<< f(r) - f(l - 1)<<endl;
        cout << ff(l,r)<< endl;
        //cout << f1(l,r) << endl;
    //cout<<f(l-1)<<endl;
    return 0;
}


#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using ull = unsigned long long;
using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using pll = pair<ll, ll>; using vl = vector<ll>; using vvl = vector<vl>; using vvvl = vector<vvl>;
using pdd = pair<double, double>; using vd = vector<double>; using vvd = vector<vd>; using vvvd = vector<vvd>;
using pbb = pair<bool, bool>; using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using pss = pair<string, string>; using vs = vector<string>; using vvs = vector<vs>; using vvvs = vector<vvs>;
#define repeat(counter, start, goal, step) for (int counter = (int)(start); counter < (int)(goal); counter += step)
#define rep(counter, times) repeat(counter, 0, times, 1)
#define rep2(counter, start, goal) repeat(counter, start, goal, 1)
#define rep0(times) repeat(counter, 0, times, 1)
#define rrepeat(counter, start, goal, step) for (int counter = (int)(start); counter > (int)(goal); counter -= step)
#define rep3(counter, start, goal) rrepeat(counter, start, goal, 1)
#define rrep(counter, start, goal) rrepeat(counter, start - 1, goal - 1, 1)
#define all(container) begin(container), end(container)
template <typename T> bool chmax(T &x, const T &y) { if (x < y) { x = y; return true; } return false; }
template <typename T> bool chmin(T &x, const T &y) { if (x > y) { x = y; return true; } return false; }
void yn(bool flag) { cout << (flag ? "yes" : "no") << "\n"; }
void Yn(bool flag) { cout << (flag ? "Yes" : "No") << "\n"; }
void YN(bool flag) { cout << (flag ? "YES" : "NO") << "\n"; }
void set_prec(const int &digits) { cout << fixed << setprecision(digits); cerr << fixed << setprecision(digits); }
template <typename T> void pr(const T &obj) { cerr << obj; }
template <typename T, typename ...Ts> void pr(const T &first, const Ts &...rest) { pr(first); pr(", "); pr(rest...); }
template <typename S, typename T> void pr(const pair<S, T> &pair) { pr("("); pr(pair.first); pr(", "); pr(pair.second); pr(")"); }
template <typename T> void pr(const vector<T> &vec) { pr("{"); for (T obj : vec) { pr(obj); pr(", "); } pr("}"); }
template <typename T> void pr(const vector<vector<T>> &vv) { pr("\n"); rep(index, vv.size()) { pr("["); pr(index); pr("]: "); pr(vv[index]); pr("\n"); } }
template <typename T> void pr(const set<T> &vec) { pr("{"); for (T obj : vec) { pr(obj); pr(", "); } pr("}"); }
template <typename S, typename T> void pr(const map<S, T> &map) { pr("{"); for (pair<S, T> pair : map) { pr("("); pr(pair.first); pr(": "); pr(pair.second); pr("), "); } pr("}"); }
#define db(obj) cerr << #obj << ": "; pr(obj); cerr << " "
#define dl(obj) db(obj); cerr << "\n";
#define dm(...) cerr << "(" << #__VA_ARGS__ << "): ("; pr(__VA_ARGS__); cerr << ") "
#define dml(...) dm(__VA_ARGS__); cerr << "\n"
// #include <atcoder/all>
// using namespace atcoder;
// const ll MOD = 1000000007;
// const ll MOD = 998244353;

int main() {
	int N, S, D; cin >> N >> S >> D;
	vi X(N), Y(N);
	rep(i, N) cin >> X[i] >> Y[i];
	bool f = false;
	rep(i, N) if (X[i] < S && Y[i] > D) f = true;
	Yn(f);
}

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

const int maxn = 2e5+10;

int n, a[maxn], b[maxn], p[maxn];
int pre[maxn];
vector<pair<int,int> > ans;

void debug() {
	printf("p: ");
	REP(i,1,n) printf("%d%c", p[i], " \n"[i==n]);
	printf("pre: ");
	REP(i,1,n) printf("%d%c", pre[i], " \n"[i==n]);
}

void solve(int i) {
	int mn = i;
	vector<int> loop;
	for (int x = p[i]; x != i; x = p[x]) {
		if (b[p[x]] < b[p[mn]]) mn = x;
	}
	for (int x = pre[mn]; x != mn; x = pre[x]) {
		ans.push_back(make_pair(x, p[x]));
	}
	for (int x = p[i]; x != i; x = p[x]) {
		loop.push_back(x);
	}
//	printf("SOLVE: %d %d\n", i, (int)loop.size());
	for (int x = 0; x < (int)loop.size(); ++x) {
		p[loop[x]] = pre[loop[x]] = loop[x];
	}
}

signed main() {
	scanf("%d", &n);
	REP(i,1,n) scanf("%d", a+i);
	REP(i,1,n) scanf("%d", b+i);
	REP(i,1,n) scanf("%d", p+i), pre[p[i]] = i;
	REP(i,1,n) {
		if (p[i] != i && b[p[i]] >= a[i]) {
			puts("-1");
			return 0;
		}
	}
	REP(i,1,n) if (p[i] != i) solve(i);
	printf("%d\n", (int)ans.size());
	REP(i,0,(int)ans.size()-1) {
		printf("%d %d\n", ans[i].first, ans[i].second);
	}
}


#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(const vl &base, const vl &v1, const vl &v2) {
  // v1, v2でminを見る
  ll ans = 1e18;
  int len1 = v1.size();
  REP(i, len1) {
    auto idx = lower_bound(ALL(v2), v1[i]) - v2.begin();
    chmin(ans, abs(v1[i] - v2[idx]));
    if (idx > 0) {
      chmin(ans, abs(v1[i] - v2[idx - 1]));
    }
  }

  // baseをはさむ
  int lenb = base.size();
  ll bv1 = 1e18, bv2 = 1e18;

  if (lenb == 0) {
    return ans;
  }

  REP(i, lenb) {
    // dp1の更新
    auto idx = lower_bound(ALL(v1), base[i]) - v1.begin();
    if (idx < v1.size())
      chmin(bv1, abs(base[i] - v1[idx]));
    if (idx > 0) {
      chmin(bv1, abs(base[i] - v1[idx - 1]));
    }
  }

  REP(i, lenb) {
    // dp2の更新
    auto idx = lower_bound(ALL(v2), base[i]) - v2.begin();
    if (idx < v2.size())
      chmin(bv2, abs(base[i] - v2[idx]));
    if (idx > 0) {
      chmin(bv2, abs(base[i] - v2[idx - 1]));
    }
  }

  chmin(ans, bv1 + bv2);

  return ans;
}

// generated by online-judge-template-generator v4.7.1 (https://github.com/online-judge-tools/template-generator)
int main() {
  int N;
  std::cin >> N;
  vl r, g, b;
  REP(i, 2 * N) {
    ll a;
    char c;
    cin >> a >> c;
    if (c == 'R') {
      r.push_back(a);
    } else if (c == 'G') {
      g.push_back(a);
    } else {
      b.push_back(a);
    }
  }
  sort(ALL(r));
  sort(ALL(g));
  sort(ALL(b));

  int cr, cg, cb;
  cr = r.size();
  cg = g.size();
  cb = b.size();
  if (cr % 2 == 0 && cb % 2 == 0 && cg % 2 == 0) {
    cout << 0 << endl;
  } else if (cr % 2 == 0) {
    cout << solve(r, g, b) << endl;
  } else if (cg % 2 == 0) {
    cout << solve(g, r, b) << endl;
  } else if (cb % 2 == 0) {
    cout << solve(b, r, g) << endl;
  } else {
    assert(false);
  }
  return 0;
}

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include <vector>

#pragma region macros
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) _range(i, 0, n)
#define _range(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__)
#define _rrep(i, n) _rrange(i, n, 0)
#define _rrange(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)
#define rrep(...) _overload(__VA_ARGS__, _rrange, _rrep, )(__VA_ARGS__)
#pragma endregion macros

using namespace std;

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

using ll    = long long;
using R     = long double;
const R EPS = 1e-9L;  // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R &r) {
    return (r > EPS) - (r < -EPS);
}
inline R sq(R x) {
    return sqrt(max(x, 0.0L));
}

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

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void) {
    int n, m;
    cin >> n >> m;
    vector<int> w(n);
    rep(i, n) cin >> w[i];

    vector<int> l(m), v(m);
    rep(i, m) {
        cin >> l[i] >> v[i];
    }

    const int wmax = *max_element(begin(w), end(w));
    rep(i, m) {
        if (wmax > v[i]) {
            cout << -1 << endl;
            return 0;
        }
    }

    using pii = pair<int, int>;
    vector<pii> bridge;
    rep(i, m) {
        bridge.push_back(pii(v[i], l[i]));
    }
    sort(begin(bridge), end(bridge));

    rep(i, 1, m) {
        chmax(bridge[i].second, bridge[i - 1].second);
    }
    bridge.erase(unique(begin(bridge), end(bridge)), end(bridge));

    m = bridge.size();

    // rep(i, m) {
    //     cerr << bridge[i].first << " " << bridge[i].second << endl;
    // }

    vector<int> ary(n);
    iota(begin(ary), end(ary), 0);

    const ll inf = 1LL << 30;
    ll ans       = inf;

    do {
        ll dist[8][8];
        rep(i, n) rep(j, n) {
            dist[i][j] = (i == j) ? 0 : inf;
        }

        // d_i <= d_{i + 1}
        rep(i, n - 1) {
            dist[i + 1][i] = 0;
        }

        rep(f, n) rep(t, f + 1, n) {
            int cur = 0;
            rep(i, f, t + 1) {
                cur += w[ary[i]];
            }

            auto it = lower_bound(begin(bridge), end(bridge), pii(cur, 0));
            if (it != begin(bridge)) {
                const int tar = prev(it)->second;
                chmin<ll>(dist[t][f], -tar);
            }
        }

        rep(k, n) rep(i, n) rep(j, n) {
            chmin(dist[i][j], dist[i][k] + dist[k][j]);
        }

        // cerr << "Dist:" << endl;
        // cerr << dist[0][n - 1] << endl;
        // cerr << dist[n - 1][0] << endl;

        chmin(ans, -dist[n - 1][0]);
    } while (next_permutation(begin(ary), end(ary)));

    cout << ans << endl;

    return 0;
}


#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    ll a,b;cin>>a>>b;
    for(ll res=b;res>=1;res--){
        ll buf=(a+res-1)/res;
        ll buf1=buf*res,buf2=(buf+1)*res;
        if((a<=buf1&&buf1<=b)&&(a<=buf2&&buf2<=b)){
            cout<<res<<endl;
            return 0;
        }
    }
}

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define tc int t; cin>>t; while(t--)
#define file_read(x,y) freopen(x, "r", stdin); \
                  freopen(y, "w", stdout);
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
   	double a,b;
   	cin >> a >> b;
   	cout << setprecision(9) << (a - b) / (double) a * 100 << "\n";
}


#include <cstdio>
#include <map>

typedef long long LL;

LL x, y;

std::map<LL, LL> mp;

inline LL abs_(LL x) { return x < 0 ? -x : x; }
inline LL min_(LL a, LL b, LL c) { return a > b ? (b > c ? c : b) : (a > c ? c : a); }
inline LL min_(LL a, LL b) { return a > b ? b : a; }

LL solve(LL t) {
	if(mp[t]) return mp[t];
	else if(t == 1) return mp[t] = abs_(x - t);
	else if(t & 1) return mp[t] = min_(abs_(x - t), solve((t + 1) / 2) + 2, solve((t - 1) / 2) + 2);
	else return mp[t] = min_(abs_(x - t), solve(t / 2) + 1);
}

int main() {
	std::scanf("%lld%lld", &x, &y);
	std::printf("%lld\n", solve(y));
	return 0;
}

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

int main(){
    int x,y;
    cin >> x >> y;
    int ans=0;
    if(x==y){
        ans=x;
    }else{
        ans=3-x-y;
    }
    cout << ans <<endl;
}


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

#define all(x) (x).begin(), (x).end()
#define dbl(k, x) fixed << setprecision(k) << (x)

template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}

#define _upgrade                \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)

// ********************** CODE ********************** //

long long go(long long sum, long long del, long long n) {
  if (n == 0) {
    if (sum != 0 && sum % 3 == 0) {
      return del;
    } else {
      return 1e18;
    }
  }

  int last = n % 10;
  n /= 10;

  return min(go(sum + last, del, n), go(sum, del + 1, n));
}

int main() {
  _upgrade;
  long long n;
  cin >> n;
  long long res = go(0LL, 0LL, n);
  cout << (res == 1e18 ? -1 : res) << '\n';
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define int long long int
#define pii pair<int,int>
const int INF= 1e12;
const int MAX=5e6+5;
const int MAXK=105;
const int mod = 1e9+7;
int gcd(int a, int b)
{
    while(b!=0)
    {
        a=a%b;
        swap(a,b);
    }
    return a;
}
int binpow(int a,int b)
{
    int res=1;
    while(b>0)
    {
        if(b%2==1)
            res=res*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return res;
}
/*
 * check modulus when using binpow
 */
void solve()
{
    double val = 1.08;
    int n;
    cin>>n;
    val=floor(val*n);
    //cout<<val<<"\n";
    if(val<206)
    {
        cout<<"Yay!";
    }
    else if(val==206)
    {
        cout<<"so-so";
    }
    else
    {
        cout<<":(";
    }

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


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cmath>
#include<iomanip>
#define pi 3.14159265358979323846
#define mod 1000000007
#define int long long
#define elif else if
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
signed main(){
  int n, m = 0, t = 0;
  double y = 0;
  cin >> n;
  rep(i, 0, n){
    int k;
	cin >> k;
    if(k < 0){
      k *= (-1);
    }
    m += k;
    if(k > t){
      t = k;
    }
    y += k * k;
  }
  y = sqrt(y);
  cout << m << "\n" << setprecision(20) << y << "\n" << t << "\n";
}

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

#include<bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

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

#define ll long long
#define f first
#define s second
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);
typedef pair<ll , pair<ll, ll> > pi;
int pow(int x,int y){
    int res=1;
    while(y){
        if(y&1) res*=x;
        y>>=1;
        x*=x;
    }
    return res;
}
struct Compare {
    constexpr bool operator()(pi const & a,
                              pi const & b) const noexcept
    { return a.first < b.first || (a.first == b.first && a.second.first > b.second.first); }

};
void prefix_function( string s,ll arr[] )
{
     long long border=0; arr[0]=0;
    for(long long i=1;i<s.size();i++)
    {
      while(border>0 && s[i]!=s[border])
        border=arr[border-1];

     if(s[i]==s[border])
         border++;
      else
       border=0;

      arr[i]=border;
    }
}//send mod-2 for a^-1 if mod is a prime number

ll mod=998244353;
ll add( ll a , ll b)
{
    return (((a%mod)+(b%mod))%mod);
}
ll mul(ll a,ll b)
{
  return (((a%mod)*(b%mod))%mod);
}
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b & 1) res = mul(res, a);
        a = mul(a, a);
        b >>= 1;
    }
    return res;
}
ll subs(ll a,ll b)
{
    return (((a%mod)-(b%mod)+mod)%mod);
}
ll dv(ll a,ll b)
{
    ll inv=binpow(b,mod-2);
    return mul(a,inv);
}

ll dsu_arr[100000];
ll dsu_sz[100000];
void dsu(ll n)
{
    for(ll i=0;i<=n;i++)
    {
        dsu_arr[i]=i;
        dsu_sz[i]=1;
    }
}
ll find(ll x)
{
     ll root=x;
    while (root!=dsu_arr[root])
    {
        root=dsu_arr[root];
    }
    while(x!=dsu_arr[x])
    {
        dsu_arr[x]=root;
        x=dsu_arr[x];
    }
    return root;
}
ll merge(ll x,ll y)
{
    ll root1=find(x);
    ll root2=find(y);

    if(root1==root2)
    return 0ll;

    if(dsu_sz[x]>dsu_sz[y]){
    dsu_arr[root2]=root1;
    dsu_sz[root1]+=dsu_sz[root2];
    }
    else
    {
         dsu_sz[root2]+=dsu_sz[root1];
        dsu_arr[root1]=root2;
    }
    return 1ll;
}
/*
vector<ll>adj[100005];
bool vis[100005];
ll dist[100005];
void bfs(ll c)
{
  vis[c]=true;
  dist[c]=0;
  queue<ll>q;
  q.push(c);
while(!q.empty())
{
    ll x=q.front();
    q.pop();

    for(ll i=0;i<adj[x].size();i++)
    {
        ll y=adj[x][i];
        if(!vis[y])
        {
            vis[y]=true;
            dist[y]=dist[x]+1;

            q.push(y);
        }
    }

}
}
*/

int main()
{
    Fast
 ll test;
 ll n;
 cin>>n;
 double b=0;
 ll a=0,c=0;
 for(ll i=0;i<n;i++)
 {
     ll k;
     cin>>k;
     a+=abs(k);
     c=max(c,abs(k));
     b+=(k*k);
 }
 double d=sqrt(b*1.00);
 cout<<setprecision(15)<<fixed;
 cout<<a<<'\n'<<d<<'\n'<<c<<endl;

}


#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e6 + 1;
long long pre[N],a[N];
int n;
int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) a[i] = a[i - 1] + a[i];
    for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + a[i];
    long long res = 0 , value = 0;
    for (int i = 1; i <= n; i++){
        value = max(value,a[i]);
        res = max(res,pre[i - 1] + value);
    }
    cout << res;
    return 0;
}

/*
Solved by sid2104
on 11/11/2020  22:32
*/
#include <bits/stdc++.h>
using namespace std;
#define int         long long
#define float       long double
#define pb          push_back
#define ld          long double
#define f(i,a,b)    for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vpii         vector<pair<int,int> >
#define mii         map<int,int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl;cout.flush();
//#define debug(x)    ;
//#define debug(x)    ;
// === Debug macro starts here ===

int recur_depth = 0;
#ifdef DEBUG
#define dbg(x) {++recur_depth; auto x_=x; --recur_depth; cerr<<string(recur_depth, '\t')<<"\e[91m"<<__func__<<":"<<__LINE__<<"\t"<<#x<<" = "<<x_<<"\e[39m"<<endl;}
#else
#define dbg(x)
#endif
template<typename Ostream, typename Cont>
typename enable_if<is_same<Ostream,ostream>::value, Ostream&>::type operator<<(Ostream& os,  const Cont& v){
    os<<"[";
    for(auto& x:v){os<<x<<", ";}
    return os<<"]";
}
template<typename Ostream, typename ...Ts>
Ostream& operator<<(Ostream& os,  const pair<Ts...>& p){
    return os<<"{"<<p.first<<", "<<p.second<<"}";
}

// === Debug macro ends here ===
#define mp          make_pair
#define x           first
#define y           second
#define pb          push_back
#define endl        '\n'
#define si(x)       (int)((x).size())
#define IOS         ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt         freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define elasped_time 1.0 * clock() / CLOCKS_PER_SEC
#define tree        vector<vector<int> >
#define PI          3.14159265358979323846
int inf=99999999999;
const int mod=1e9+7;
const int cmp=1e17;
inline int gcd(int a, int b) {
  while (a > 0 && b > 0) {
    if (a > b) a %= b;
    else b %= a;
  }
  return a + b;
}
void inp(int n,int arr[])
{
    f(i,0,n) cin>>arr[i];
}
int ans=0;
void solve()
{
  int sum=0;
  int curr=0;
  int currm=0;
  int n;
  cin>>n;
   f(i,0,n)
   {
     int k;
     cin>>k;
     curr+=k;

     currm=max(curr,currm);
     ans=max(ans,sum+currm);
     sum+=curr;

   }
   cout<<ans<<endl;

}
main()
{
    IOS;
    solve();

}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define pii pair<
#define fi first
#define se second
#define pb push_back

const int N = 2002;
const ll mod = 1e12+7;
ll m, n, t, k, a[N], ans, b[N], d[N], tong, idx, mn, c[N];

vector< pll > adj[N], adt[N];
vector<ll> kq, v;
string s;
void check(ll x)
{
    if(kq.empty())return;
    vector<ll> pre, res;
    for(int i = 0; i < kq.size(); i ++)
    {
        if(a[kq[i]] >= x)pre.pb(kq[i]);
    }
    swap(kq, pre);
    if(kq.empty())return;
    priority_queue< ll, vector<ll>, greater<ll> > pq;
    pq.push(a[kq[0]]);
    for(int i = 1; i < kq.size(); i ++)
    {
        if(kq[i] == kq[i-1] + 1)pq.push(a[kq[i]]);
        else
        {
            while(pq.size() >= k)
            {
                res.pb(pq.top());
                pq.pop();
            }
            while(!pq.empty())pq.pop();
            pq.push(a[kq[i]]);
        }
    }
    while(pq.size() >= k)
    {
        res.pb(pq.top());
        pq.pop();
    }
    if(res.size() < m)return;
    sort(res.begin(), res.end());
    ans = min(ans, res[m-1] - res[0]);
}
void sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        if(a[i] < 1 || a[i] > n)
        {
            cout << "No";
            return;
        }
        ++b[a[i]];
    }
    for(int i = 1; i <= n; i ++)
    {
        if(b[i] != 1)
        {
            cout << "No";
            return;
        }
    }
    cout << "Yes";
}
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    sol();
}
/*
nC1 * (m-1)^(i-1) +
*/

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

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

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

  sort(A.begin(), A.end());
  for (int i=1; i<N; i++) {
    if ((A[0] == 1) && (A[i-1] + 1 == A[i])) {
      // Do nothing
    } else {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}


// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

int main() {
    int N; cin >> N;
    string s, t; cin >> s >> t;

    ll pari_1 = 0, pari_2 = 0;
    for(int i=0; i<N; i++) {
        if(s[i] == '0') pari_1++;
        if(t[i] == '0') pari_2++;
    }
    // 0 の個数について S のほうがおおい
    if(pari_1 > pari_2) {
        puts("-1");
        return 0;
    }
    pari_1 %= 2;
    pari_2 %= 2;
    // 偶奇があってない
    if(pari_1 != pari_2) {
        puts("-1");
        return 0;
    }

    // 貪欲にマッチさせる
    vector<int> js;
    for(int i=0; i<N; i++) if(t[i] == '1') js.emplace_back(i);
    int M = js.size();
    ll ans = 0, pre = -1, j = 0;
    for(int i=0; i<N; i++) {
        if(s[i] == '0') continue;
        // T 側の 1 とマッチ
        if(j < M and js[j] <= i) {
            ans += i - js[j++];
        }
        else {
            // まだ存在しない
            if(pre < 0) pre = i;
            else {
                // 存在するのでマッチさせる
                ans += i - pre;
                pre = -1;
            }
        }
    }

    // 最後までマッチしていない
    if(j != M or pre >= 0) puts("-1");
    else printf("%lld\n", ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int max_n = 505555, inf = 1000111222;

char buf[max_n];

string read() {
    scanf("%s", buf);
    return buf;
}

int n;
string s, t;

void wa() {
    puts("-1");
    exit(0);
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    scanf("%d", &n);
    s = read();
    t = read();
    vector<int> a, b;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '1') {
            a.push_back(i);
        }
        if (t[i] == '1') {
            b.push_back(i);
        }
    }
    if (a.size() % 2 != b.size() % 2) {
        wa();
    }
    long long ans = 0;
    int pos = 0;
    for (int i : b) {
        while (pos < a.size() && a[pos] < i) {
            ans += a[pos + 1] - a[pos];
            //cout << "$" << a[pos] << " " << a[pos + 1] << endl;
            pos += 2;
        }
        if (pos >= a.size()) {
            wa();
        }
        //cout << "@" << a[pos] << " " << i << endl;
        ans += a[pos] - i;
        ++pos;
        ++i;
    }
    if (pos % 2 != a.size() % 2) {
        wa();
    }
    while (pos < a.size()) {
        ans += a[pos + 1] - a[pos];
        pos += 2;
    }
    cout << ans << "\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
#include <cstring>

//ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1e9 + 7;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

int cans(bool f){
    if(f) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

int main() {
    int H,W;
    cin >> H >> W;
    char S[H][W];
    rep(i,H) {
	rep(j,W) {
	    cin >> S[i][j];
	}
    }
    int ans = 0;
    rep(i,H-1) {
	rep(j,W-1) {
	    int num = 0;
	    if(S[i][j] == '#') num++;
	    if(S[i][j+1] == '#') num++;
	    if(S[i+1][j] == '#') num++;
	    if(S[i+1][j+1] == '#') num++;

	    if(num == 1 || num == 3) ans++;
	}
    }
    cout << ans << endl;

    return 0;

}

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

using namespace std;

typedef long long ll;

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

bool check(vector<char> v){
	int cnt = count(v.begin(),v.end(), '.');
	return cnt % 2 == 1;
}

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

	int h, w;
	cin >> h >> w;

	vector<string> b(h);
	rep(i, h) cin >> b[i];

	int ans = 0;
	rep(i, h-1) rep(j, w-1){
		if(check({b[i][j], b[i][j+1], b[i+1][j], b[i+1][j+1]})) ans++;
	}

	cout << ans << endl;
}


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

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

int solve(string S) {
    if ("atcoder" < S) {
        return 0;
    }
    rep(i, S.size()) {
        if (S[i] > 't') {
            return i - 1;
        } else if (S[i] > 'a') {
            return i;
        }
    }
    return -1;
}

int main() {
    int T;
    cin >> T;
    rep(i, T) {
        string S;
        cin >> S;
        cout << solve(S) << endl;
    }
}

#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

ll func(){
    string str = in<string>();
    int res = INF;
    string atcoder = "atcoder";
    if(str > atcoder)return 0;
    rep(i,min<int>(str.size(),atcoder.size())){
        rep(j,str.size()){
            if(i==j)continue;
            swap(str[i],str[j]);
            if(atcoder < str.substr(0,min<int>(str.size(),atcoder.size()+1)))chmin(res,abs(i-j));
            swap(str[i],str[j]);
        }
    }
    if(res==INF)return -1;
    return res;
}

int main(){
    int n = in();
    rep(i,n){
        cout << func() << endl;
    }
  return 0;
}


#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#include<queue>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for (int i=0;i<(n);++i)
using ll = long long;
using namespace std;
using P = pair<int,int>;
#define INF 110000

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if(b - (c*d) >= 0){
        cout<<-1<<endl;
        return 0;
    }

    d = (c*d)-b;
    int count = 0;
    if(a%d == 0) count = a/d;
    else count = (a/d) + 1;
    cout<<count<<endl;
    return 0;
}

#define MOD_TYPE 2

#pragma region Macros

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

#if 0
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using Int = boost::multiprecision::cpp_int;
using lld = boost::multiprecision::cpp_dec_float_100;
#endif
#if 1
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#endif
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr int INF = (int)1e9 + 10;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-8;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define REPI(i, m, n) for (int i = m; i < (int)(n); ++i)
#define repi(i, n) REPI(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

struct io_init
{
  io_init()
  {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(30) << setiosflags(ios::fixed);
  };
} io_init;
template <typename T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
inline ll CEIL(ll a, ll b)
{
  return (a + b - 1) / b;
}
template <typename A, size_t N, typename T>
inline void Fill(A (&array)[N], const T &val)
{
  fill((T *)array, (T *)(array + N), val);
}
template <typename T, typename U>
constexpr istream &operator>>(istream &is, pair<T, U> &p) noexcept
{
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
constexpr ostream &operator<<(ostream &os, pair<T, U> &p) noexcept
{
  os << p.first << " " << p.second;
  return os;
}
#pragma endregion

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

void solve()
{
  int n;
  cin >> n;
  vector<ld> a(n);
  rep(i, n) cin >> a[i];

  auto f = [&](const ld x) {
    ld sum = 0;
    rep(i, n)
    {
      sum += x + a[i] - min(a[i], x * 2);
    }
    return sum / n;
  };

  auto ternary_search = [&]() {
    ld left = 0, right = LINF;
    rep(simulate_times, 300)
    {
      ld t1 = (2.0 * left + right) / 3.0;
      ld t2 = (left + 2.0 * right) / 3.0;
      if (f(t1) > f(t2))
        left = t1;
      else
        right = t2;
    }
    return f(left);
  };
  cout << ternary_search() << "\n";
}

int main()
{
  solve();
}


#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a*a+b*b<c*c) printf("Yes\n");
	else printf("No\n");
	return 0;
}

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int mod=1e9+7;
//Note:
// 1.Perform binary search on sorted array only.
// 2.For ceil caculations we can use something like ceil(10/(double)3)-->>4

#define ff              first
#define ss              second
#define pb              push_back
#define int             long long
#define MOD         1000000007
#define mod         1000000007
#define mod2            998244353
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define ll              long long
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

const int N = 200005;

 bool myCompare(int a,int b)
{
  return a>b;
}
bool isPrime(int n)
{

    if (n <= 1)
        return false;

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

    return true;
}
bool isPalindrome(string str)
{

    int l = 0;
    int h = str.length() - 1;

    while (h > l)
    {
        if (str[l++] != str[h--])
        {

            return false;
        }
    }
   return true;
}

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

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

        if (prime[p] == true)
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
}
 int power(int x, unsigned int y)
{
    int res = 1;     // Initialize result

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = res*x%mod;

        // y must be even now
        y = y>>1; // y = y/2
        x = x*x % mod;  // Change x to x^2
    }
    return res%mod;
}

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

    a=(a*a)%M;

    b=b>>1;
    }
   return result;

}
int modInv(int a){return power(a,MOD-2);}
int fact[N],inv[N];
void factorial(int n){
	fact[0]=1;
	for(int i=1;i<=n;i++){
		fact[i]=fact[i-1]*i;
		if(fact[i]>=MOD)
			fact[i]%=MOD;
	}
}
void InvFactorial(int n){
	inv[0]=1;
	for(int i=1;i<=n;i++)
		inv[i]=modInv(fact[i]);
}
int ncr(int n,int r){

	if(n<r||n<0||r<0)
		return 0;
	int b=inv[n-r];
	int c=inv[r];
	int a=fact[n]*b;
	if(a>=MOD)
		a%=MOD;
	a*=c;
	if(a>=MOD)
		a%=MOD;
	return a;
}

void solve() {
   int a,b,c;
   cin>>a>>b>>c;
   int x=a*a;
   int y=b*b;
   int z=c*c;
//   cout<<x<<" "<<y<<" "<<z;
   if((x+y)<z)
   cout<<"Yes";
   else
   cout<<"No";

  }

signed main()
{
      ios;
      int test;
      test=1;
      int tc=1;
    //   factorial(N-1);
    //   InvFactorial(N-1);

    // SieveOfEratosthenes(N-1);
      // cin>>test;

      while(test--)
      {
          //cout<<"Case #"<<tc<<": ";
         solve();
      }

    return 0;
	}


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

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

  double c = 100*b/a;

  cout << 100-c << endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(ll i = a; i < (n); ++i)
#define repD(i, a, n) for(ll i = a; i > (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (long long) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
// #define mp make_pair
#define pb push_back

void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
const long double PI = 3.141592653589793238462643383;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long int> vll;
typedef vector<double> vd;
typedef vector<pii> vii;
long long Ceil(long long a, long long b){
    if(a%b==0) return a/b;
    else return (a/b)+1;
}
ll p=1000000007;
// ll p = 1000000000000000000+5;
float E = 0.00000000000001;
ll power(ll x, ll y){
    if(y==0){
        return 1;
    }
    if(y%2==0){
        ll q=power(x,y/2);
        q=q%p;
        return (q*q)%p;
    }
    ll q=power(x,y/2);
    q=q%p;
    return ((x%p)*((q*q)%p))%p;
}
bool isPowerOfTwo (long long x)
{
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));
}

long long int gcd(long long int a, long long int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
long long int mod(long long int a, long long int b) {
    long long int ret = a%b; return ret>=0? ret: ret+b;
}

int main(){
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t = 1;
    // cin>>t;
    while(t--){
        float a,b;
        cin>>a>>b;
        std::cout << std::fixed << std::setprecision(2);
        cout<<abs((b/a-1)*100);
    }
    return 0;
}


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

int main(void){
	read(n);
	read(m);
	ll A=f(n,m);
	ll B=f(n,m*m);
	printf("%lld",(B-A)/m);
	return 0;
}

/*
 ______________________     _______ _______ _______ _______
(  ____ \__   __(  __  \   (  ____ |  ___  |  ____ (  ___  )
| (    \/  ) (  | (  \  )  | (    )| (   ) | (    \/ (   ) |
| (_____   | |  | |   ) |  | (____)| (___) | (_____| (___) |
(_____  )  | |  | |   | |  |     __)  ___  (_____  )  ___  |
      ) |  | |  | |   ) |  | (\ (  | (   ) |     ) | (   ) |
/\____) |__) (__| (__/  )  | ) \ \_| )   ( /\____) | )   ( |
\_______)_______(______/___|/   \__//     \_______)/     \|
                      (_____)
I didn't come this far to only come this far */
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define fl(i, a, b) for (int i = a; i < b; i++)
#define vi vector<int>
#define e1(a) \
    int a;    \
    cin >> a;
#define e2(a, b) \
    int a, b;    \
    cin >> a >> b;
#define e3(a, b, c) \
    int a, b, c;    \
    cin >> a >> b >> c;
#define av(arr, n)      \
    vector<int> arr(n); \
    fl(i, 0, n) cin >> arr[i];
#define aa(arr, n) \
    int arr[n];    \
    fl(i, 0, n) cin >> arr[i];
#define es(s)  \
    string(s); \
    cin >> (s);
#define rz resize
#define sz(s) s.size()
#define mod 1000000007
#define ff first
#define ss second
#define tn -10e15
#define bg 10e15
#define all(x) (x).begin(), (x).end()
#define pii pair<int, int>
#define mii map<int, int>
#define st(a, n) memset(a, n, sizeof(a))
#define vl(n) cout << n << "\n"
#define vs(n) cout << n << " "
#define el cout << "\n"
#define vn(n) cout << n
#define dsc greater<int>()
#define ps(x, y) fixed << setprecision(y) << x
#define R return
#define B break
#define C continue
#define YC cout << "YES" \
                << "\n"
#define YS cout << "Yes" \
                << "\n"
#define NC cout << "NO" \
                << "\n"
#define NS cout << "No" \
                << "\n"
#define lcm(a, b) (a / __gcd(a, b)) * b
#define pa(a)        \
    for (auto e : a) \
    cout << e << " "
const int N = 4e5 + 5;
// Twist the ques
// tweek well know algos
// if(eq)try to simplify
// Read the statements carefully

void solve()
{
    e2(n, m);
    int a[n][m];
    int mx = bg;
    fl(i, 0, n)
    {
        fl(j, 0, m)
        {
            cin >> a[i][j];
            mx = min(a[i][j], mx);
        }
    }
    int ans = 0;
    fl(i, 0, n)
    {
        fl(j, 0, m)
        {
            ans += a[i][j] - mx;
        }
    }
    vl(ans);
}

int32_t main()
{

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

    solve();

    return 0;
}


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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a == b && a != c) cout << c << endl;
	else if (a == c && a != b) cout << b << endl;
	else if (b == c && b != a) cout << a << endl;
	else if (a != b && b != c) cout << "0" << endl;
	else if(a == b && b == c) cout << a << endl;
}

#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int A,B,W;
    vector<int> candi;
    scanf("%d %d %d",&A,&B,&W);
    W = W * 1000;

    if(W%B == 0 && W/B<=W/A)
        printf("%d %d\n", W/B, W/A);
    else if(W/B+1<=W/A)
        printf("%d %d\n", W/B+1,W/A);
    else
        printf("UNSATISFIABLE\n");
}


#include<iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  if(N%2==0)cout << "White" << endl;
  if(N%2==1)cout << "Black" << endl;
  return 0;
}

// --------------------------------------------------<C++ TEMPLATE>------------------------------------------------
/**
    *  Nitin Gangwar
    *  @wargang (codechef,codeforces,spoj,gfg)
    *  MNNIT allahabad
    *  CSE'23
    *  iamnitingangwar2000@gmail.com
**/

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

// MACROS
#define int                     long long
#define mp                      make_pair
#define pb                      push_back
#define MAX                     1e9
#define MIN                     -1e9
#define PI                      3.1415926535897932384626433832795
#define mod                     1000000007
#define set(x)                  memset(x, 0, sizeof(x))
#define clr(x)                  memset(x, -1, sizeof(x))
#define ff                      first
#define ss                      second
#define rep(i,n)                for(int i=0;i<(n);i++)
#define FOR(i,a,b)              for(int i=(a);i<=(b);i++)
#define FORD(i,a,b)             for(int i=(a);i>=(b);i--)
#define test()                  int t;cin>>t;while(t--)
#define endl                    "\n"

typedef priority_queue<int>     maxHeap;
typedef priority_queue<int,     vector<int>, greater<int>> minHeap;
typedef pair<int, int>          pii;
typedef vector<int>             vi;
typedef vector<string>          vs;
typedef vector<pii>             vpii;
typedef vector<vi>              vvi;
typedef map<int, int>            mpii;
typedef set<int>                seti;
typedef multiset<int>           mseti;
// typedef long int                ld;
// typedef unsigned long int       lu;
// typedef long long int           ll;
// typedef unsigned long long int  llu;

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

void solve(){
    int n;
    cin>>n;
    if(n&1)
        cout<<"Black";
    else
        cout<<"White";

}

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

        solve();

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int n;
string s,t;
int main(){
        cin>>n>>s>>t;
        reverse(s.begin(),s.end());
        reverse(t.begin(),t.end());
        s=" "+s;t=" "+t;
        int base=1;
        bool con[10],tmp[10];
        for(int i=0;i<10;i++)con[i]=0,tmp[i]=0;
        con[0]=1;
        for(int i=1;i<=n;i++){
                if(t[i]=='T'){
                        for(int i=0;i<10;i++)tmp[i]=0;
                        int add=base*(s[i]-'0')%7;
                        for(int i=0;i<7;i++)if(con[i])tmp[(i+add)%7]=1;
                        for(int i=0;i<7;i++)if(tmp[i])con[i]=1,tmp[i]=0;
                }else{
                        bool tmp[2][10];
                        for(int i=0;i<7;i++)tmp[0][i]=tmp[1][i]=0;
                        int add=base*(s[i]-'0')%7;
                        for(int i=0;i<7;i++)if(con[i])tmp[0][i]=1,tmp[1][(i+add)%7]=1;
                        for(int i=0;i<7;i++)con[i]=(tmp[0][i]&&tmp[1][i]);
                }
                base=base*10%7;
        }
        if(con[0])cout<<"Takahashi\n";
        else cout<<"Aoki\n";
        return 0;
}

#include<bits/stdc++.h>
using namespace std;
void __print(int x){cout<<x;}void __print(long x){cout<<x;}
void __print(long long x){cout<<x;}void __print(unsigned x){cout<<x;}
void __print(unsigned long x){cout<<x;}void __print(unsigned long long x){cout<<x;}
void __print(float x){cout<<x;}void __print(double x){cout<<x;}
void __print(long double x){cout<<x;}void __print(char x){cout<<'\''<<x<<'\'';}
void __print(const char *x){cout<<'\"'<<x<<'\"';}void __print(const string &x){cout<<'\"'<<x<<'\"';}
void __print(bool x) {cout<<(x?"true":"false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define lp(i,a,b)       for (ll i=a;i<=b;i++)
#define rp(i,a,b)       for (ll i=a;i>=b;i--)
#define ms(a,x)         memset(a,x,sizeof a)
#define ll              long long
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define pb              push_back
#define nl              cout<<"\n"
#define gcd(a,b)        __gcd((a),(b))
#define lcm(a,b)        ((a)*(b))/(gcd(a,b))
#define sq(a)           ((a)*(a)*(a))
#define sz(a)           (int) a.size()
#define mod             1000000007
#define PI              (2*acos(0.0))
const ll N=2e5+5;
vector<array<ll,2>> g[N];
ll A[N];
void dfs(ll node,ll p,ll x)
{
  A[node]=x;
  for(auto [adj,cost]:g[node])
  {
    if(adj!=p) dfs(adj,node,x^cost);
  }
}
void solve()
{
  ll n;
  cin>>n;
  lp(i,1,n-1)
  {
    ll a,b,c;
    cin>>a>>b>>c;
    g[a].pb({b,c});
    g[b].pb({a,c});
  }
  dfs(1,-1,0);
  ll res=0;
  lp(i,0,60)
  {
    ll one=0,zero=0;
    lp(j,1,n)
    {
          if(A[j] & 1ll<<i) one++;
          else zero++;
    }
    res=((res)+(1ll<<i)%mod*one%mod*zero%mod)%mod;
  }
  cout<<res;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  int T=1;
  //cin>>T;
  while(T--) solve();
}


#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include<cstdio>
#include<functional>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <list>
#include <cassert>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define ll long long
#define repi(i,a,b) for(ll i=a;i<b;++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

using namespace std;
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
using vvv = vector<vector<vector<ll>>>;
using vv = vector<vector<ll>>;
using vec = vector<ll>;
using P = pair<ll, ll>;

bool isOK(ll n,ll k, vv al, ll mid) {
	vv tmp1(n, vec(n));
	rep(i, n) {
		rep(j, n) {
			if (al[i][j] <= mid) {
				tmp1[i][j] = 1;
			}
		}
	}
	vv tmp2(n, vec(n));
	rep(i, n) {
		rep(j, n) {
			if(j - 1 >= 0) tmp2[i][j] = tmp1[i][j] + tmp2[i][j - 1];
			else tmp2[i][j] = tmp1[i][j];
		}
	}
	rep(j, n) {
		rep(i, n) {
			if (i - 1 >= 0) tmp2[i][j] = tmp2[i][j] + tmp2[i - 1][j];
		}
	}
	ll cnt = -1;
	rep(i, n) {
		rep(j, n) {
			if (i + k >= n || j + k >= n) break;
			ll r = tmp2[i + k][j + k];
			if (i - 1 >= 0) {
				r -= tmp2[i - 1][j + k];
			}
			if (j - 1 >= 0) {
				r -= tmp2[i + k][j - 1];
			}
			if (i - 1 >= 0 && j - 1 >= 0) {
				r += tmp2[i - 1][j - 1];
			}
			cnt = max(cnt, r);
		}
	}
	if (((k + 1) * (k + 1)) % 2 && cnt >= (k + 1) * (k + 1) / 2 + 1) return true;
	else if (((k + 1) * (k + 1)) % 2 == 0 && cnt >= (k + 1) * (k + 1) / 2) return true;
	else return false;
}

int main(void) {
	ll n, k; cin >> n >> k;
	vv al(n, vec(n));
	ll mv = 0;
	rep(i, n) {
		rep(j, n) {
			ll a; cin >> a;
			mv = max(mv, a);
			al[i][j] = a;
		}
	}
	int ng = -1;
	int ok = mv;
	while (abs(ok - ng) > 1) {
		int mid = (ok + ng) / 2;
		if (isOK(n, k - 1,al, mid)) ok = mid;
		else ng = mid;
	}
	cout << ok << endl;
	system("pause");
}

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;

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

  vector<int> p(2*n,-1),l(2*n,-1),r(2*n,-1);
  vector<bool> v(2*n+1);
  v[0] = [&]{
    rep(i,n){
      if(a[i]!=-1){
        --a[i];
        if(l[a[i]]!=-1||r[a[i]]!=-1) return false;
        l[a[i]]=i;
      }
      if(b[i]!=-1){
        --b[i];
        if(l[b[i]]!=-1||r[b[i]]!=-1) return false;
        r[b[i]]=i;
      }
      if(a[i]!=-1&&b[i]!=-1){
        if(b[i]<=a[i]) return false;
        p[a[i]] = b[i];
        p[b[i]] = a[i];
      }
    }
    return true;
  }();
  auto f = [&](int a,int b){
    if(r[a]!=-1) return false;
    if(l[b]!=-1) return false;
    if(l[a]!=-1&&r[b]!=-1&&l[a]!=r[b]) return false;
    if(p[a]!=-1&&p[a]!=b) return false;
    if(p[b]!=-1&&p[b]!=a) return false;
    return true;
  };
  for(int p=0;p<2*n;p+=2){
    if(!v[p]) continue;
    for(int d=1;p+2*d<=2*n;++d){
      if(v[p+2*d]) continue;
      v[p+2*d] = [&]{
        rep(i,d) if(!f(p+i,p+d+i)) return false;
        return true;
      }();
    }
  }
  cout << (v[2*n]?"Yes":"No") << endl;
}


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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,L,R) for(int i=L;i<R;i++)
using namespace std;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<vector<int>> Graph;
typedef vector<string> Grid;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}

//#define DEBUG

//declaration area

/*

struct{
    constexpr operator int(){return int(1e9)+1;}
    constexpr operator ll(){return ll(1e18)+1;}
    constexpr auto operator-(){
        struct{
            constexpr operator int(){return -int(1e9)-1;}
            constexpr operator ll(){return -ll(1e18)-1;}
        }_ret;
        return _ret;
    }
}inf;

*/

//struct area

//function area

//main area
int main(){
    string s;
  	cin >> s;
  	if(s[0] == s[1] && s[1] == s[2]) cout << "Won" << endl;
  	else cout << "Lost" << endl;
}
/*

*/


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

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

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

ll dp[1<<18][18];

int main(){
    int N; cin >> N;
    int x[N],y[N],z[N];
    for(int i=0;i<N;i++){
        cin >> x[i] >> y[i] >> z[i];
    }
    for(int i=0;i<(1<<18);i++){
        for(int j=0;j<18;j++){
            dp[i][j]=INF;
        }
    }
    dp[0][0]=0;
    for(int bit=0;bit<(1<<N);bit++){
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++){
                ll res=abs(x[j]-x[i])+abs(y[j]-y[i])+max(0,z[j]-z[i]);
                dp[bit|(1<<j)][j]=min(dp[bit|(1<<j)][j],dp[bit][i]+res);
            }
        }
    }
    cout << dp[(1<<N)-1][0] << endl;
}

#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 (int i = (l); i < (r); ++i)
#define REP(i,n) FOR(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 SUM(c) accumulate(ALL(c), 0)
#define SUMLL(c) accumulate(ALL(c), 0LL)
#define SZ(c) ((int)(c).size())
#define debug(x) cerr << #x << " = " << (x) << '\n';
using P = pair<int,int>;
using VP = vector<P>;
using VVP = vector<VP>;
using VS = vector<string>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<ll>;
using VVLL = vector<VLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VD = vector<double>;
using VVD = vector<VD>;
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 int INF = 1 << 30;  // 1073741824
// static const ll INF = 1LL << 62;  // 4611686018427387904
// --------------------------------------------------------
// #include <atcoder/all>
// using namespace atcoder;

static const int MAX_N = 17;
VVI dp((1 << MAX_N), VI(MAX_N, INF));

struct city {
    int X, Y, Z;
};

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

    int N; cin >> N;

    vector<city> C(N);
    REP(i, N) {
        int X, Y, Z; cin >> X >> Y >> Z;
        C[i] = city{X, Y, Z};
    }

    VVI G(N, VI(N, INF));
    REP(i, N-1) FOR(j,i+1,N) {
        city a = C[i];
        city b = C[j];
        G[i][j] = abs(b.X - a.X) + abs(b.Y - a.Y) + max(0, b.Z - a.Z);
        G[j][i] = abs(a.X - b.X) + abs(a.Y - b.Y) + max(0, a.Z - b.Z);
    }

    dp[0][0] = 0;
    FOR(S, 1, (1 << N)) {
        FOR(u, 0, N) {
            if (!(S & (1 << u))) continue;
            int T = S - (1 << u);
            FOR(v, 0, N) {
                if (G[v][u] == INF) continue;
                dp[S][u] = min(dp[S][u], dp[T][v] + G[v][u]);
            }
        }
    }
    int ans = dp[(1 << N) - 1][0];
    cout << ans << '\n';

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
typedef long double ld;
const int inf = 1e9 + 7;
const int mod = 998244353;
const int maxn = 1e6 + 3;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < b; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define lb lower_bound
#define ub upper_bound
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod);
#define mod_in(a) exp(a, mod-2)
#define ncr(n, r) ((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod)
#define deb(x) cout << #x << " " << x << endl;
#define flash ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;*/

ll prime[4000005];
ll exp(ll a,ll b);
void sieve(ll n);
ll gcd(ll a ,ll b);
ll countdigit(ll n);
vector<ll>ft;
int main()
{
    flash;
    ll t=1;
   // sieve(4000003);
    //ft.pb(1);
    //fact(10000001);
    //cin >> t;
        ll n,m;
        cin >> n >> m;

        if (m == 0) {
            cout << 1;
            return 0;
        }
        ll a[m];

        rep(i,0,m){
            cin>>a[i];
        }
        sort(a,a+m);

        vector<ll>gaps;

        rep(i,1,m){
            gaps.pb(a[i]-a[i-1]-1);
        }
        gaps.pb(n-a[m-1]);

        gaps.pb(a[0]-1);

        ll ans = n;

    if (!gaps.empty()) for (auto i : gaps) {
        if (i > 0)
            ans = min(ans, i);
    }
    ll count = 0;
    if (!gaps.empty()) for (auto i : gaps) {
        if (i > 0)
            count += (i/ans + (i%ans != 0));
    }
    cout << count;

}

//
//
//
//
//
// IMPORTANT FUNCTIONS
ll exp(ll a, ll b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res%mod;
}
ll gcd(ll a,ll b){
    if(a==0)return b;
    return gcd(b%a,a);
}
void sieve(ll n) {
    for(ll i=0;i<=n;i++) {
        prime[i]=1;
    }
    prime[0]=0;prime[1]=0;
    for(ll i=2;i<=n;i++) {
        if(prime[i]==1) {
            for(ll j=2;i*j<=n;j++) {
                prime[i*j]=0;
            }
        }
    }
}
ll countdigit(ll  n)
{
    return floor(log10(n) + 1);
}

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

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

#define all(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define un_map unordered_map
#define rep(i,a,n) for (int i = a; i < n; ++i)
#define rrep(i,a,n) for (int i = a; i >= n; --i)
#define irep(i,a,n,inc) for (int i = a; i < n; i += inc)
#define endl "\n"

typedef long long ll;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

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

#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define int long long

long long POW(long long a, long long b) {
	long long ans = 1;
	while (b) {
			if(b & 1) {
					ans = ans * a;
			}
			a = a * a;
			b /= 2;
	}
	return ans;
}

int const nax = 2e5 + 11;
int a[nax];
int n, m;

int32_t main() {
  IOS;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) cin >> a[i];
  a[m + 1] = n;
  sort(a, a + m + 2);
  int minn = 1e18;
  for (int i = 1; i < m + 2; ++i) {
		int x = a[i] - a[i - 1];
		if (i != m + 1) {
			if (x > 1) {
				minn = min(minn, x - 1);
			}
		}else {
			if (x) {
				minn = min(minn, x);
			}
		}
	}
	//debug(minn);
	if (minn == 1e18) {
		cout << 0;
		return 0;
	}
	int ans = 0;
	for (int i = 1; i < m + 2; ++i) {
		int y = a[i] - a[i - 1];
		if (i != m + 1) {
			ans += (y + minn - 2) / minn;
		}else {
			ans += (y + minn - 1) / minn;
		}
	}
	cout << ans;
}