#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define sz(a) ((int) (a).size())
#define all(x) (x).begin(), (x).end()

const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);

template <class T> T sqr (T x) {return x * x;}
template <class T> T abs (T x) {return x < 0 ? -x : x;}

template <class T>
vector<T> ReadVector(int n) {
    vector<T> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    return a;
}

template <class T>
void WriteVector(const vector<T>& a) {
    for (int i = 0; i < sz(a); ++i) {
        cout << a[i] << (i + 1 < sz(a) ? ' ' : '\n');
    }
}

void DFS(const vector<vector<int>>& a, int v, vector<int>& used) {
    used[v] = true;
    for (int i = 0; i < sz(a[v]); ++i) {
        if (!used[i] && a[v][i]) {
            DFS(a, i, used);
        }
    }
}

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

    vector<vector<int>> a(n, vector<int>(n));
    for (int i = 0; i < n; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < n; ++j) {
            a[i][j] = (s[j] == '1');
        }
    }

    vector<vector<int>> a_rev(n, vector<int>(n));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            a_rev[i][j] = a[j][i];
        }
    }

    double res = 0;
    for (int i = 0; i < n; ++i) {
        vector<int> used(n);
        DFS(a_rev, i, used);

        int cnt = 0;
        for (int j = 0; j < n; ++j) {
            cnt += used[j];
        }

        res += 1.0 / cnt;
    }

    cout.precision(20);
    cout << res << "\n";
}

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

    // clock_t start_clock = clock();

    // freopen("_input.txt", "rt", stdin);
    // freopen("_output.txt", "wt", stdout);

    int tc = 1;
    // cin >> tc;
    for (int ti = 0; ti < tc; ++ti) {
        Solve();
    }

    // double total_seconds = (double) (clock() - start_clock) / CLOCKS_PER_SEC;
    // cerr << "Working time: " << total_seconds << "s." << endl;

    return 0;
}

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

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

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

int main() {
  lin(N);
  lin(M);
  ll data[N][N];
  rep(i,N) rep(j,N) data[i][j]=inf;

  rep(i,M) {
lin(a); lin(b); lin(c);
    chmin(data[a-1][b-1],c);
  }

  //Warshal-floyd neu
 rep(k,N) {
   rep(i,N) {
     if(data[i][k]==inf) {
       continue;
     }

     rep(j,N) {//rep1
       if(data[k][j]==inf) {
         continue;
       }
       else {
         chmin(data[i][j],data[i][k]+data[k][j]);
       }
     }//rep1

   }
 }

  rep(i,N) {
    if(data[i][i]==inf) {
      co(-1);
    }
    else {
      co(data[i][i]);
    }

  }

}


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

int main() {
    float x=0,y=0,z=0;
    int a=0;
    cin >> x >> y >> z;

    while(y/x > a/z){
        a++;
    }
    cout << a -1;
}

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n)
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
using Edge = pair<int, ll>;
const int MAX = 100000;
const ll INF = 1LL << 60;

int main()
{
    // cin高速化
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y, z;
    cin >> x >> y >> z;
    cout << (z * y - 1) / x << "\n";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
template <typename T>
void read(T &x) {
	x = 0; char c = getchar(); int f = 0;
	for (; !isdigit(c); c = getchar())
		f |= c == '-';
	for (; isdigit(c); c = getchar())
		x = x * 10 + (c ^ '0');
	if (f) x = -x;
}
template <typename T>
void write(T x, char ed = '\n') {
	if (x < 0) putchar('-'), x = -x;
	static short st[30], tp;
	do st[++tp] = x % 10, x /= 10; while (x);
	while (tp) putchar(st[tp--] | '0');
	putchar(ed);
}

const int N = 1005000;
int ans, n;
char s[N];
inline int C(int n, int m) {
	if (m > n) return 0;
	if (n >= 3) return C(n / 3, m / 3) * C(n % 3, m % 3) % 3;
	if (n == 2) return 1 + (m == 1);
	return 1;
}

int main() {
	read(n), scanf ("%s", s + 1);
	for (int i = 1;i <= n; ++i) {
		int c = (s[i] > 'B') + (s[i] > 'R');
		ans += C(n - 1, i - 1) * c;
	}
	if (~n & 1) ans *= -1;
	ans = (ans % 3 + 3) % 3;
	if (ans == 0) putchar('B');
	else if (ans == 1) putchar('R');
	else putchar('W');
	return 0;
}

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
using pll=pair<ll, ll>;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e18
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
//priority_queue<ll, vector<ll>, greater<ll>> Q;
/*

*/

char add_wbr(char a, char b){
  if (a==b) return(a);
  if (a=='W' && b=='R') return('B');
  if (a=='W' && b=='B') return('R');
  if (a=='B' && b=='W') return('R');
  if (a=='B' && b=='R') return('W');
  if (a=='R' && b=='W') return('B');
  if (a=='R' && b=='B') return('W');
  return (0);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll N;
  string S;
  cin >> N >> S;
  ll sz=S.size();
  while (sz>1){ // 4->1, 5->4->1
    while(sz%3!=1){
      string T;
      for(ll j=0; j<sz-1; j++)
        T+=add_wbr(S[j], S[j+1]);
      S=T;
      sz=S.size();
    }
    string T;
    for(ll j=0; j+3<sz; j+=3)
      T+=add_wbr(S[j], S[j+3]);
    if (T[0]) S=T;
    sz=S.size();
  }
  cout << S[0] << endl;
}


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

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

    int i = 0;
    int txtsize = str.size();
    string after = "";

    for (int j = txtsize; j >= 0; j--)
    {
        string ch = str.substr(j, 1);

        if (ch == "6")
        {
            ch = "9";
        }
        else if (ch == "9")
        {
            ch = "6";
        }

        after += ch;

        i++;
    }

    std::cout << after << std::endl;
}

#include <bits/stdc++.h>

using namespace std;

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

    reverse(s.begin(), s.end());

    for (int i = 0; i < s.size(); i++) {
        if (s[i] == '6') {
            cout << '9';
        }
        else if (s[i] == '9') {
            cout << '6';
        }
        else {
            cout << s[i];
        }
    }

    cout << endl;

}


//wtrl,everybody hangbeat me
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,pii> piiii;
typedef vector<pii> vii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef queue<char> qc;
typedef queue<string> qs;
typedef vector<char> vc;
typedef vector<string> vs;
typedef map<char,int> mpci;
typedef map<int,int> mpii;
typedef map<string,int> mpsi;
typedef set<int> sei;
typedef set<char> sec;
typedef set<string> ses;
typedef stack<ll> si;
typedef stack<char> sc;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<pll> vpll;
typedef vector<pdd> vdd;
typedef unsigned int uint;
typedef long double ld;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vii> vvii;
/*=====================================================================*/
#define pb push_back
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define sz(a) (int)(a.size())
#define len(a) (int)(a.length())
#define all(s) (s).begin(),(s).end()
#define fi first
#define se second
#define be begin
#define en end
#define m_p make_pair
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define forn(i,p,n) for(int i=p;i<=n;i++)
#define ford(i,p,n) for(int i=n;i>=p;i--)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();++i)
#define zero(a) memset(a,0,sizeof(a))
#define number(a,num) memeset(a,num,sizeof(a))
#define INF 1e9
#define PI acos(-1)

/*=====================================================================*/

string int_to_string(ll n)
{
	string s="";
	while(n)
	{
		ll now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
ll string_to_int(string s)
{
	ll n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
/*======================================================================*/
ll lcm(int a,int b)
{
	return a/__gcd(a,b)*b;
}
bool prime(int n)
{
	if(n==0||n==1)
	  return false;
	for(int i=2;i*i<=n;i++)
	  if(n%i==0)
	    return false;
	return true;
}
string turn(int n,int k)
{
	string s="";
	while(n)
	{
		s+=(char)(n%k+'0');
		n/=k;
	}
	reverse(s.begin(),s.end());
	return s;
}
const string turn16(int n)
{
	string s="";
	while(n!=0)
	{
		if(n%16>9)
		  s+=(char)('A'+n%16-10);
		else
		  s+=(char)('0'+n%16);
		n/=16;
	}
	reverse(s.begin(),s.end());
	return s;
}
/*======================================================================*/
const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};
const int month[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31},{31,29,31,30,31,30,31,31,30,31,30,31}};
ll h,w,k,ans,inv=1,dp[5010][5010],mod=998244353;
char a[5010][5010];
/*======================================================================*/
int main()
{
    std::ios::sync_with_stdio(false);
  /*
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
  */
  /*====================================================================*/
    cin>>h>>w>>k;
	int r,c;
	char x;
	rep(i,k)
	{
		cin>>r>>c>>x;
		a[--r][--c]=x;
	}
	while(inv%3)
	{
	 inv+=mod;
    }
	inv/=3;
	dp[0][0]=1;
	rep(i,h)
	{
	  rep(j,w)
	  {
		if(a[i][j]!='R'&&i+1<h)
		{
			dp[i+1][j]+=dp[i][j]*(a[i][j]==0?2*inv:1);
			dp[i+1][j]%=mod;
		}
		if(a[i][j]!='D'&&j+1<w)
		{
			dp[i][j+1]+=dp[i][j]*(a[i][j]==0?2*inv:1);
			dp[i][j+1]%=mod;
		}
	  }
    }
	ans=dp[h-1][w-1];
	rep(i,h*w-k)
	{
	  ans=ans*3%mod;
    }
	cout<<ans<<endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
constexpr long long INF = 1000000000 + 100;
constexpr long long LINF = 1000000000000000000 + 100;
constexpr double EPS = 1e-9;
#define all(v) v.begin(), v.end()
#define rep(i, n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll tsp_to_return(vector<vector<ll>>& adj){
    int k = adj.size();
    ll inf = 1LL<<60;
    //dp[mask][i]:=通過済みの地点の集合がmaskで、現在地が頂点iである場合の最小コスト
    vector<vector<ll>> dp(1 << k, vector<ll>(k, inf));
    dp[0][0] = 0;

    for(int mask=1; mask<(1<<k)-1; mask++){
        for(int i=1; i<k; i++){
            if(!(mask >> i & 1)){
                for(int j=0; j<k; j++){
                    if(mask >> j & 1){
                        chmin(dp[mask][i], adj[j][i] + dp[mask ^ 1 << j][j]);
                    }
                }
            }
        }
    }
    ll res = inf;
    rep(i, k)chmin(res, dp[((1<<k)-1) ^ 1 << i][i] + adj[i][0]);
    return res;
}

ll X[20], Y[20], Z[20];
int main(){
    int N; cin >> N;
    rep(i, N)cin >> X[i] >> Y[i] >> Z[i];

    vector<vector<ll>> adj(N, vector<ll>(N));
    rep(i, N){
        rep(j, N){
            adj[i][j] = abs(X[j]-X[i]) + abs(Y[j]-Y[i]) + max(0LL, Z[j]-Z[i]);
        }
    }

    cout << tsp_to_return(adj) << ln;
}


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

int main()
{
    string N;
    cin >> N;
    int k = N.length();
    vector<int> v(10, 0);
    REP(i, k)
    {
        v.at(N.at(i) - '0')++;
    }

    vector<int> m(3, 0); //mod 3
    int sum = 0;
    REP(i, 10)
    {
        m.at(i % 3) += v.at(i);
        sum += i * v.at(i);
    }

    int mod = sum % 3;

    if (mod == 0)
    {
        cout << 0 << endl;
    }
    else if (mod == 1)
    {
        if (k >= 2 && m.at(1) >= 1)
        {
            cout << 1 << endl;
        }
        else if (k >= 3 && m.at(2) >= 2)
        {
            cout << 2 << endl;
        }
        else
        {
            cout << -1 << endl;
        }
    }
    else if (mod == 2)
    {
        if (k >= 2 && m.at(2) >= 1)
        {
            cout << 1 << endl;
        }
        else if (k >= 3 && m.at(1) >= 2)
        {
            cout << 2 << endl;
        }
        else
        {
            cout << -1 << endl;
        }
    }else{
        cout << -1 << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007

const ll mod = 1e9 + 7;

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

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin>>s;
	ll n=s.length();
	ll ans=0;
	ll a;
	ll b;
	ll c;
	a=b=c=0;
	for(ll i=0;i<n;i++){
		ll cur=s[i]-'0';
		ans=(ans+cur)%3;
		if(cur%3==0)
			a++;
		else if(cur%3==1)
			b++;
		else
			c++;
	}
	if(ans==0)
		cout<<"0\n";
	else{
		if(ans==1){
			if(b>0 && n>1)
				cout<<"1\n";
			else if(c>1 && n>2)
				cout<<"2\n";
			else
				cout<<"-1\n";
		}
		else{
			if(c>0 && n>1)
				cout<<"1\n";
			else if(b>1 && n>2)
				cout<<"2\n";
			else
				cout<<"-1\n";
		}
	}
}


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

//イテレーション
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define FORA(i,I) for(const auto& i:I)
//x:コンテナ
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())
//定数
#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf
//#define MOD 1000000007 //問題による
//略記
#define F first
#define S second
//出力(空白区切りで昇順に)
#define coutALL(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<" ";cout<<*--x.end()<<endl;

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long S, long long D, std::vector<long long> X, std::vector<long long> Y){
  REP(i, N) {
    if (X[i] < S && Y[i] > D) {
      cout << YES << endl;
      return;
    }
  }
  cout << NO << endl;
}

signed main(){
  //小数の桁数の出力指定
  cout<<fixed<<setprecision(10);
  //入力の高速化用のコード
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  long long N;
  scanf("%lld",&N);
  long long S;
  scanf("%lld",&S);
  long long D;
  scanf("%lld",&D);
  std::vector<long long> X(N);
  std::vector<long long> Y(N);
  for(ll i = 0 ; i < N ; i++){
    scanf("%lld",&X[i]);
    scanf("%lld",&Y[i]);
  }
  solve(N, S, D, std::move(X), std::move(Y));
  return 0;
}

#line 1 "main.cpp"
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

void solve() {
    int n, s, d;
    cin >> n >> s >> d;

    while (n--) {
        int x, y;
        cin >> x >> y;

        if (x < s && y > d) {
            cout << "Yes\n";
            return;
        }
    }

    cout << "No\n";
}

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

    solve();

    return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<ll> x(n);
    for (int i = 0; i < n; ++i) {
        cin >> x[i];
    }

    vector<ll> p { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
    int m = p.size();
    ll ans = 1ll << 62;
    for (int bit = 0; bit < (1 << m); ++bit) {
        ll res = 1;
        for (int i = 0; i < m; ++i) {
            if (bit >> i & 1) {
                res *= p[i];
            }
        }
        bool ok = true;
        for (int i = 0; i < n; ++i) {
            ll g = __gcd(res, x[i]);
            if (g == 1) ok = false;
        }
        if (ok) ans = min(ans, res);
    }
    cout << ans << endl;
}

/*Practice.Practice.Practice.
Created: SAADxENCIPHERER*/
#include <bits/stdc++.h>

using namespace std;
#define fast_io ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define int long long
#define pb push_back
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep1(i, n) for (ll i = n - 2; i >= 0; i--)
#define repi(i, n) for (ll i = 1; i <= n; i++)
#define repi1(i, n) for (ll i = n; i >= 1; i--)
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define CLOCK cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
typedef vector<ll> vi;
typedef vector<char> vc;
#define mp make_pair
#define ss second
#define mod 1000000007
const int MAX = 100005;
const int inf = 1e18;

int max(int a,int b)
{
  if(a>b)
    return a;
  else
    return b;
}

 int M, Aq[103];
int P[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};

void solve()
{
    cin >> M;
    int Ans = false;
    int Sz = 15;
    for(int i = 1; i <= M; i++) cin >> Aq[i];
    for(int mask = 1; mask < (1 << Sz); mask++){
        int Res = 1;
        for(int i = 0; i < Sz; i++){
            if(mask & (1 << i)){
                Res *= P[i];
            }
        }
        bool Was = false;
        for(int i = 1; i <= M; i++){
            if(__gcd(Res, Aq[i]) == 1) Was = true;
        }
        if(!Was){
            if(!Ans) Ans = Res;
            else Ans = min(Ans, Res);
        }
    }
    cout << Ans;
}

int32_t main()
{
      fast_io;
    int T=1;
 // cin>>T;
    while(T--)
    {
      solve();

     }
 }


#include<bits/stdc++.h>
#define IONAME "cttf"
typedef long long ll;

int n;
std::set<std::string> x,y;
std::string ss[222000];

void marota(){
    std::cin>>n;
    for (int i=1;i<=n;i++){
        std::string s;
        std::cin>>s;
        ss[i]=s;
        if (ss[i][0]=='!') ss[i]=ss[i].substr(1,(int)ss[i].size()-1);
        if (s[0]=='!') y.insert(s.substr(1,(int)s.size()-1));
        else x.insert(s);
    }
    int err=0;
    for (int i=1;i<=n && !err;i++){
        if (x.find(ss[i])!=x.end() && y.find(ss[i])!=y.end()){
            std::cout<<ss[i];
            err=1;
        }
    }
    if (!err) std::cout<<"satisfiable";
}

int main(){
    std::ios_base::sync_with_stdio(false);
    std::cin.tie();
    std::cout.tie();
    #ifdef IONAME
        if(fopen(IONAME".inp", "r") != nullptr){
            freopen(IONAME".INP","r",stdin);
            freopen(IONAME".OUT","w",stdout);
        }
    #endif
    marota();
    return 0;
}

///OM
///SUVOM SHAHA
///AUST CSE 39

#include<bits/stdc++.h>
#define loo(i, n) for(int i = 0; i < n; i++)
#define modo 1000000007
#define pb push_back
#define ff first
#define sc second
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define ll long long int
#define inf 1000000000
#define mpch map<char, int>
#define mpint map<int, int>
#define endl '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
//to iterate map -> for(auto i : mp)
//vector of pair -> vec.pb(make_pair(a, b));
//reverse sort -> sort(ara, ara+n, greater<int>());
//modulus -> a = ((a%modo)+modo)%modo

using namespace std;

int main(void)

{
    ll n, i, a, b = 0;
    cin>>n;
    for(i = 0; i < n; i++){
        cin>>a;
        if(a > 10) b += (a-10);
    }
    cout<<b<<endl;
    return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define countSetBits(x) __builtin_popcountll(x)
#define trailz(x) __builtinctzll(x)
#define leadz(x) __builtinclzll(x)
#define endl          '\n'
#define integer       int
#define int           long long
#define vec           vector
#define fo(i,b)       for(int i=0;i<b;i++)
#define Fo(i,k,n)     for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define debug(args...) cerr << "["#args"] = ["; dbg,args; cerr << "]" << endl;
struct debugger {
  template<typename T> debugger& operator , (const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
#define bug(arr,a) { Fo(i,0,a) cerr<<arr[i]<<" "; cerr<<endl; }
void kick2309()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #ifndef ONLINE_JUDGE
    freopen("error.txt", "w", stderr);
  #endif
}
void solve()
{
   int a,b,c,d;
   cin>>a>>b>>c>>d;
   //a - cyan balls + b- cyan balls +c - red ball
   // target - a+b crose d*c
   int cyan=a;
   int red=0;
   int ans = 0;
   while(1){
    cyan+=b;
    red+=c;
    ans++;
    if(red*d>=cyan) break;
    else{
      if(d*c<=b) {
        cout<<-1<<endl;
        return;
      }
    }
   }
   cout<<ans<<endl;

  }
int32_t main()
{
  kick2309();
  int t = 1;
  //cin >> t;
  while (t--)
  {
    solve();
  }
#ifndef ONLINE_JUDGE
  cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
  return 0;
}

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

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

    int t;
    cin >> t;
    const ll mod = 1e9 + 7;

    REP(_, 0, t)
    {
        ll n, a, b;
        cin >> n >> a >> b;
        if (n - a - b < 0)
        {
            cout << 0 << "\n";
            continue;
        }
        ll comb_a = (n - a + 1) * (n - a + 1) % mod;
        ll comb_b = (n - b + 1) * (n - b + 1) % mod;
        ll comb = comb_a * comb_b % mod;
        ll sub = ((n - a + 1) * (n - b + 1) - (n - a - b + 2) * (n - a - b + 1)) % mod;
        sub = sub * sub % mod;
        cout << (comb - sub + mod) % mod << "\n";
    }
}


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

void fillPrefixSum(int arr[], int n, int prefixSum[]) 	// a[i-1,j-1] = a[j-1] - a[i-2];
{
    prefixSum[0] = arr[0];
    // Adding present element
    // with previous element
    for (int i = 1; i < n; i++)
        prefixSum[i] = prefixSum[i - 1] + arr[i];
}

int main(){
    fast

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

        int arr[n];

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

        ll sum = 0;
        for(int i=0;i<n;i++){
            if( arr[i] > 10){
                sum += arr[i] - 10;
            }
        }
        cout << sum <<endl;

    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
//using Graph = vector<vector<int>>;

const int MOD = 1000000007;
typedef pair<int,int> P;

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

}

//最小公倍数
ll lcm(ll a,ll b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

// 10進数から2進数
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}

// Union-Find
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    int size(int x) {
        return -par[root(x)];
    }
};

ll powmod(ll x,ll y){
    ll res=1;
    for(ll i=0;i<y;i++){
        res=res*x%MOD;
    }
    return res;
}

int main() {
 ll n;
 cin >> n;
 ll a[n],b[n];
 rep (i,n) {
   cin >> a[i] >> b[i];
 }
 vector <ll> sum(1000010,0);
 rep (i,1000001) {
   sum[i] += i;
   sum[i+1] += sum[i];
 }
 ll ans = 0;
 rep (i,n){
   ans += sum[b[i]] - sum[a[i] - 1];
 }
 cout << ans << endl;
}


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

struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};

int main() {
    int n, ans = 0;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; ++i) cin >> a[i];
    UnionFind uf(200010);
    for(int i = 0; i < n/2; ++i) {
        if(a[i] != a[n-i-1]) {
            uf.merge(a[i], a[n-i-1]);
        }
    }

    for(int i = 0; i < 200010; ++i) {
        if(uf.root(i) == i) ans += uf.size(i) - 1;
    }

    cout << ans << '\n';

    return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define pdd pair<ld, ld>
#define int long long
#define ff first
#define pii pair<int,int>
#define ss second
#define pp make_pair
#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define PI 3.1415926535
#define mst(v, x) memset(v, x, sizeof v);
#define all(v) v.begin(), v.end()
#define dpq priority_queue<int>
#define ipq priority_queue<int, vector<int>, greater<int>>
#define setbits(x)          __builtin_popcountll(x)
using namespace std;
void IOS(){ios::sync_with_stdio(false); cout.precision(10); cout << fixed;}
const int MOD = 1e9 + 7;
#define INF 2000000000
const int mx=1e5+1;
int dx[] = {0,0,1,-1}, dy[] = {1,-1,0,0};

int i;
vector<bool>fl(200005, false);
int cnt;
using Graph = vector<vector<int>>;
Graph g(200003);

void dfs(int x){
	if(!fl[x])return;
	fl[x] = 0;
	for(auto & nx : g[x])dfs(nx);
}

int32_t main(){
	IOS();
	int n;
	cnt = 0;
	cin>>n;

	vector<int>ar(n);
	rep(i,n){
		cin>>ar[i];
		if(!fl[ar[i]])fl[ar[i]] = 1, cnt++;
	}
	int i = 0, j=n-1;
	while(i<j){
		g[ar[i]].pb(ar[j]);
		g[ar[j]].pb(ar[i]);
		i++; j--;
	}
	for(int i=0; i<=200002; i++){
		if(fl[i]){
			cnt--;
			dfs(i);
		}
	}
	cout<<cnt<<"\n";
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
const int N = 1e5 + 10;
const ll mod = 1e9 + 7;

ll a, b, c;

ll fast_pow(ll p, ll q, ll MOD) {
    ll ans = 1;
    while (q) {
        if (q & 1) {
            ans = ans * p % MOD;
        }
        p = p * p % MOD;
        q >>= 1;
    }
    return ans;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.txt", "r", stdin);
#endif
    scanf("%lld%lld%lld", &a, &b, &c);
    ll cur = a % 10, w;
    if (cur == 0) {
        printf("0\n");
    } else if (cur == 1) {
        printf("1\n");
    } else if (cur == 2) {
        w = fast_pow(b, c, 4);
        if (!w)printf("6\n");
        else if (w == 1)printf("2\n");
        else if (w == 2)printf("4\n");
        else if (w == 3)printf("8\n");
    } else if (cur == 3) {
        w = fast_pow(b, c, 4);
        if (!w)printf("1\n");
        else if (w == 1)printf("3\n");
        else if (w == 2)printf("9\n");
        else if (w == 3)printf("7\n");
    } else if (cur == 4) {
        w = fast_pow(b, c, 2);
        if (!w)printf("6\n");
        else if (w == 1)printf("4\n");
    } else if (cur == 5) {
        printf("5\n");
    } else if (cur == 6) {
        printf("6\n");
    } else if (cur == 7) {
        w = fast_pow(b, c, 4);
        if (!w)printf("1\n");
        else if (w == 1)printf("7\n");
        else if (w == 2)printf("9\n");
        else if (w == 3)printf("3\n");
    } else if (cur == 8) {
        w = fast_pow(b, c, 4);
        if (!w)printf("6\n");
        else if (w == 1)printf("8\n");
        else if (w == 2)printf("4\n");
        else if (w == 3)printf("2\n");
    } else if (cur == 9) {
        w = fast_pow(b, c, 2);
        if (!w)printf("1\n");
        else if (w == 1)printf("9\n");
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int64_t power(int64_t base, int64_t exponent, int64_t mod) {
  base %= mod;
  int64_t result = base ? 1 : 0;
  while (exponent) {
    if (exponent & 1) {
      result *= base;
      result %= mod;
    }
    base *= base;
    base %= mod;
    exponent >>= 1;
  }
  return result;
}
int main() {
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int64_t a, b, c;
  cin >> a >> b >> c;
  cout << power(a, power(b, c, 2520), 10) << "\n";
  return 0;
}


#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define rep(i, n) for(int i=0;i<n;i++)
#define all(i, v) for(auto& i : v)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll x[n], y[n];
    rep(i, n) cin >> x[i] >> y[i];
    ll ans = 0;
    rep(i, n){
        for(int j = i + 1; j < n; j ++){
            ll dy = abs(y[j] - y[i]), dx = abs(x[j] - x[i]);
            if(dy <= dx) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF = 1e18;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) (v).begin(), (v).end()
template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;} return 0;}
template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0;}
// ここを消す
// #define DEBUG
#ifdef DEBUG
inline void debug_print() { cerr << endl; }
template <typename T1, typename... T2> void debug_print(const T1 a, const T2 &... b) { cerr << a << ' '; debug_print(b...);}
#define debug(...) cerr << __LINE__ << ':' << ' ' << '[' << #__VA_ARGS__ << ']' << '=' << ' ' , debug_print(__VA_ARGS__);
#else
#define debug(...) true
#endif

inline void print() { cout << endl; }
template <typename T1, typename... T2> void print(const T1 a, const T2 &... b) { cout << a << ' '; print(b...); }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ',' << ' ' << p.second << ')'; return os; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto e : v) os << e << ' '; return os; }
template <typename T> ostream &operator<<(ostream &os, const set<T> &v) { for (auto e : v) os << e << ' ';  return os; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, const map<T1, T2> &mp) { for (auto e : mp) os << e << ' '; return os; }

/* compress
    X を座標圧縮して書き換える（副作用）
    返り値: ソート済みの値
    計算量: O(n log n)
*/
template <typename T>
vector<T> compress(vector<T> &X) {
    // ソートした結果を vals に
    vector<T> vals = X;
    sort(vals.begin(), vals.end());
    // 隣り合う重複を削除(unique), 末端のゴミを削除(erase)
    vals.erase(unique(vals.begin(), vals.end()), vals.end());
    // 各要素ごとに二分探索で位置を求める
    for (int i = 0; i < (int)X.size(); i++) {
        X[i] = lower_bound(vals.begin(), vals.end(), X[i]) - vals.begin();
    }
    return vals;
}

/////////////////////////////////////////
// 与えられた数列から、大小関係だけを抽出したい
/////////////////////////////////////////

int main() {
    ll n, cost;
    cin >> n >> cost;
    vector<ll> p(n*2+1, 0), q(n*2+1, 0), a(n), b(n), c(n), d(n*2), day(n*2);
    vector<pair<ll,ll> > e(n*2);
    rep(i, n) {
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;
        d[i] = a[i];
        d[i + n] = b[i];
        e[i] = {a[i], i};
        e[i+n] = {b[i], i + n};
    }

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

    debug(e);

    int dayi = 0;
    day[0] = e[0].first;

    rep(i, n * 2) {
        if (e[i].first != day[dayi]) {
            dayi++;
            day[dayi] = e[i].first;
        }
        debug(dayi);
        if (e[i].second < n) {
            p[dayi] += c[e[i].second];
        } else {
            p[dayi] -= c[e[i].second - n];
        }
    }
    debug(p);
    debug(day);
    rep(i, dayi + 2) {
        if (i != 0) q[i] = q[i-1] + p[i];
        else q[i] = p[i];
    }
    debug(q);
    ll ans = 0;
    rep(i, dayi + 1) {
        ll dis;
        if (i == dayi) {
            dis = 1;
        } else {
            dis = day[i+1] - day[i];
        }
        debug(dis);
        ans += min(q[i], cost) * dis;
    }
    cout << ans << endl;
}

// DEBUGの消去を行いましたか??


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

const int MaxN=2e5;
const int MaxQ=3e5;
char ss[MaxN+1<<1];

int main(){
	int N, Q, T, A, B;

	scanf("%d\n%s\n%d\n",&N,ss,&Q);
	int base=0;
	int L=N<<1;    //L=2*N;

	while(Q-->0){
		scanf("%d %d %d",&T,&A,&B);
		if(T==2){
			base^=N;
		}else{// T==1
			A=(A-1+base)%L;
			B=(B-1+base)%L;
			swap(ss[A],ss[B]);
		}
	}

	for(int i=0;i<L;i++)
		putchar(ss[(base+i)%L]);
	return 0;
}

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

class UnionFind {
	vector<int>par, sz;
	vector<int>ed;
public:
	UnionFind() {}
	UnionFind(int n) {
		par = sz = ed = vector<int>(n);
		for (int i = 0; i < n; i++) {
			par[i] = i;
			sz[i] = 1;
			ed[i] = 0;
		}
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (sz[x] > sz[y]) {
			par[y] = x;
			sz[x] += sz[y];
			ed[x]+=ed[y];
		}
		else {
			par[x] = y;
			sz[y] += sz[x];
			ed[y]+=ed[x];
		}
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		return sz[find(x)];
	}
	void add(int x){
		x=find(x);
		ed[x]++;
	}
	int esize(int x){
		return ed[find(x)];
	}
};

//~ int in[500000];
int main(){
	int n;cin>>n;
	UnionFind uf(500000);
	rep(i,n){
		int a,b;scanf("%d%d",&a,&b);a--;b--;
		uf.unite(a,b);
		uf.add(a);
	}
	int ans=0;
	rep(i,500000){
		if(uf.find(i)==i){
			ans+=min(uf.size(i),uf.esize(i));
		}
	}
	cout<<ans<<endl;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type , less<ll> , rb_tree_tag , tree_order_statistics_Node_update>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define inf 3e18
#define mk make_pair
#define ld long double
#define mod 1000000007
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define test ll t; cin>>t; while(t--)
#define setbits __builtin_popcount
#define endl '\n'
#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i));}
sim, class b dor(pair < b, c > d) {
    ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it)
        *this << ", " + 2 * (it == d.b) << *it;
    ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
int main()
{
	ld x,y,z,w;
	cin>>x>>y>>z>>w;
	ld ans,val,val1;
	val=x*w+y*z;
	val1=w+y;
	ans=val/val1;
	cout<<fixed<<setprecision(9)<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
double res;
double x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
 printf("%.10f",(y1*x2+x1*y2)/(y1+y2));
return 0;}


// Problem: A - Maxi-Buying
// Contest: AtCoder - AtCoder Beginner Contest 206（Sponsored by Panasonic）
// URL: https://atcoder.jp/contests/abc206/tasks/abc206_a
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)

/*input

*/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define mod 1000000007

// templates
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define sz(x) (int)x.size()
#define po(x, y) fixed << setprecision(y) << x
#define ss(s) scanf(" %[^\n]%*c", s)
#define ps(s) printf("%s\n", s)
using namespace std;

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

void nl() { printf("\n"); }
void sc(int& n) {
  int number;
  scanf("%d", &number);
  n = number;
}
void sc(ll& n) {
  ll number;
  scanf("%lld", &number);
  n = number;
}
void _print(ll t) { printf("%lld ", t); }
void _print(int t) { printf("%d ", t); }
void _print(string t) { cout << t; }
void _print(char t) { printf("%c\n", t); }
void _print(lld t) { cout << t; }
void _print(double t) { cout << t; }
void _print(ull t) { cout << t; }

template <class T, class V>
void _print(pair<T, V> p);
template <class T>
void _print(vector<T> v);
template <class T>
void _print(set<T> v);
template <class T, class V>
void _print(map<T, V> v);
template <class T>
void _print(multiset<T> v);
template <class T, class V>
void _print(pair<T, V> p) {
  cout << "{";
  _print(p.F);
  cout << ",";
  _print(p.S);
  cout << "}";
}
template <class T>
void _print(vector<T> v) {
  cout << "vec->[ ";
  for (T i : v) {
    _print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void _print(set<T> v) {
  cout << "set->[ ";
  for (T i : v) {
    _print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T>
void _print(multiset<T> v) {
  cout << "multiset->[ ";
  for (T i : v) {
    _print(i);
    cout << " ";
  }
  cout << "]";
}
template <class T, class V>
void _print(map<T, V> v) {
  cout << "map->[ ";
  for (auto i : v) {
    _print(i);
    cout << " ";
  }
  cout << "]";
}

const ll inf = (ll)1e15 + 10;
const int N = (int)1e6 + 10;

void solve() {
  int n;
  sc(n);
  double r = n * 1.08;
  int s = (int)r;
  if (s < 206) {
    printf("Yay!\n");
    return;
  }
  if (s == 206) {
    printf("so-so\n");
    return;
  }
  printf(":(\n");
  return;
}

int main() {
  //#ifndef ONLINE_JUDGE
  //	freopen("input.txt", "r", stdin);
  //	freopen("output.txt", "w", stdout);
  //#endif
  int t = 1;
  // sc(t);
  while (t--) {
    solve();
  }
  return 0;
}

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define fast_cin()                    \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

int main()
{
    int n;
    cin >> n;
    if (n * 1.08 < 206)
    {
        cout << "Yay!";
    }
    else if (floor(n * 1.08) == 206)
    {
        cout << "so-so";
    }
    else
        cout << ":(";
}


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

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

constexpr ll mod=998244353;

ll mod_pow(ll a,ll b){
    a%=mod;
    if(b==0)return 1;
    if(b==1)return a;
    ll res=mod_pow(a,b/2)%mod;
    res*=res; res%=mod;
    if(b%2)res*=a;
    return res%mod;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n);
    ll sum=0;
    ll po=1;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for(int i=1;i<n;i++){
        (sum+=po*a[i]%mod)%=mod;
        po*=2; po%=mod;
    }
    ll res=0;
    for(int i=0;i+1<n;i++){
        (res+=a[i]*sum%mod)%=mod;
        // cout << res << " " << sum << endl;
        sum-=a[i+1];
        sum*=mod_pow(2,mod-2);
        sum%=mod;
    }
    for(int i=0;i<n;i++){
        (res+=a[i]*a[i])%=mod;
    }
    if(res<0)res+=mod;
    cout << res << endl;
}

#include<iostream>
#include <vector>
#include <algorithm>
#include <utility>
#define NO_MOD 998244353
using namespace std;
using ll = long long;

using ll = long long;
struct matrix{
    long long a,b,c,d;
    matrix operator*(matrix);
    matrix(ll,ll,ll,ll);
};
template<ll MOD= 1000000007>
struct modint{
    ll value;
    modint();
    modint(ll);
    modint operator+(modint);
    modint operator*(modint);
    modint operator-(modint);
    modint operator/(modint);/*gcd(value,MOD)==1であることは保証されているものとする*/
    modint inv();/*gcd(value,MOD)==1であることは保証されているものとする*/

};
std::pair<ll,ll> Bezout(ll,ll);
ll inv_mod(ll,ll);
template<ll MOD>
modint<MOD> pow(modint<MOD>,ll);

int main(){
    int n;
    cin >> n;
    vector<modint<NO_MOD>> a(n);
   vector<modint<NO_MOD>>  b(n);
    for(int i = 0;i < n;i++){
        cin >> a[i].value;
    }
    sort(a.begin(),a.end(),[](modint<NO_MOD> a,modint<NO_MOD> b){return a.value < b.value;});
    for(int i = 0;i < n;i++){
    b[i] = a[i];
        a[i] = (pow(modint<NO_MOD>(2),i)) * a[i];
    }

    vector<modint<NO_MOD>> ruiseki(n+1);
    for(int i = 0;i < n;i++){
        ruiseki[i+1] = ruiseki[i] + a[i];
    }
    modint<NO_MOD> ans(0);
    for(int i = 0;i < n-1;i++){
        ans = ans + (b[i] * (ruiseki[n] - ruiseki[i+1])/pow(modint<NO_MOD>(2),i+1));
    }
    for(int i = 0;i < n;i++){
        ans =ans + b[i] * b[i];
    }
    cout << ans.value << endl;

    return 0;
}

template<ll MOD>
modint<MOD> pow(modint<MOD> a,ll b){
    if(b == 0){
        return modint<MOD>(1);
    }
    if(b%2 == 0){
        return pow((a*a),b/2);
    }
    return pow(a,b-1) * a;
}

matrix matrix::operator*(matrix r){
    return matrix(a*r.a+b*r.c,a*r.b+b*r.d,c*r.a+d*r.c,c*r.b+d*r.d);
}
matrix::matrix(ll x,ll y,ll z,ll w):a(x),b(y),c(z),d(w){}

std::pair<ll,ll> Bezout(ll a,ll b){
    struct{
        matrix operator()(ll a,ll b){
            if(b == 0){
                return matrix(1,0,0,1);
            }
            return operator()(b,a%b) * matrix(0,1,1,-1*(a/b));
        }
    } Euclid;
    matrix ans = Euclid(a,b);
    return std::pair<ll,ll>(ans.a,ans.b);
}

template<ll MOD>
modint<MOD>::modint(ll a){
    value = a%MOD;
    if(value < 0){
        value+=MOD;
    }
}
template<ll MOD>
modint<MOD>::modint(){
    value = 0;
}
template<ll MOD>
modint<MOD> modint<MOD>::operator+(modint<MOD> r){
    return modint(value + r.value);
}
template<ll MOD>
modint<MOD> modint<MOD>::operator*(modint<MOD> r){
    return modint(value * r.value);
}
template<ll MOD>
modint<MOD> modint<MOD>::operator-(modint<MOD> r){
    return modint(value - r.value);
}
template<ll MOD>
modint<MOD> modint<MOD>::operator/(modint<MOD> r){
    return modint(value * r.inv().value);
}
template<ll MOD>
modint<MOD> modint<MOD>::inv(){
    return modint(Bezout(value,MOD).first);
}
ll inv_mod(ll a,ll mod){
    return Bezout(a,mod).first;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<map>
using std::cin;using std::cerr;
using std::max;using std::min;
#define N 10
#define M 100005
#define inf 1e9
#define ll long long
#define db double
#define dbg1(x) cerr<<#x<<"="<<(x)<<" "
#define dbg2(x) cerr<<#x<<"="<<(x)<<"\n"
int n,m,A[N],tp[N],mark[N],Sum[N],e[N][N],ans=inf;
struct info
{
	int l,v;
	friend bool operator<(info t1,info t2) {return t1.v<t2.v;}
}B[M];
int find(int v) {int l=0,r=m,mid;for(;l<r;) mid=l+r+1>>1,B[mid].v<v?l=mid:r=mid-1;return l;}
void work(int step)
{
	if(step==n+1)
	{
		for(int i=1;i<=n;i++) Sum[i]=Sum[i-1]+A[tp[i]];
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++) e[i][j]=i>j?-inf:0;
		for(int i=1,p;i<=n;i++)
			for(int j=i+1;j<=n;j++) p=find(Sum[j]-Sum[i-1]),e[i][j]=max(e[i][j],B[p].l);
		for(int k=1;k<=n;k++)
			for(int i=1;i<=n;i++)
				for(int j=1;j<=n;j++) e[i][j]=max(e[i][j],e[i][k]+e[k][j]);
		ans=min(ans,e[1][n]);
		return;
	}
	for(int i=2;i<=n;i++) if(!mark[i]) tp[step]=i,mark[i]=1,work(step+1),mark[i]=0;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d",&A[i])	;
	for(int i=1;i<=m;i++) scanf("%d%d",&B[i].l,&B[i].v);
	std::sort(A+1,A+1+n),std::sort(B+1,B+1+m),std::reverse(A+1,A+1+n);
	if(A[1]>B[1].v) return puts("-1"),0;
	for(int i=1;i<=m;i++) B[i].l=max(B[i].l,B[i-1].l);
	tp[1]=1,work(2),printf("%d\n",ans);
	return 0;
}

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

int32_t main(){
    ios::sync_with_stdio(0),cin.tie(0);
    int n,m,ans=1e18,mx=0;
    cin >> n >> m;
    int w[n],p[n];
    for(int i=0;i<n;i++){
    	cin >> w[i];
    	p[i]=i;
    	mx=max(mx,w[i]);
    }
    pair <int,int> v[m];
    for(int i=0;i<m;i++){
    	int x,y;
    	cin >> x >> y;
    	v[i]={y,x};
    }
    sort(v,v+m);
    int c[m],pf[m];
    for(int i=0;i<m;i++){
    	c[i]=v[i].first;
    	pf[i]=v[i].second;
    	if(i)pf[i]=max(pf[i],pf[i-1]);
    }
    if(c[0]<mx){
    	cout << "-1";
    	return 0;
    }
    while(1){
    	int d[n]={0};
    	for(int i=1;i<n;i++){
    		int sum=w[p[i]];
    		d[i]=d[i-1];
    		for(int j=i-1;j>=0;j--){
    			sum+=w[p[j]];
    			int id=lower_bound(c,c+m,sum)-c;
    			if(id)d[i]=max(d[i],d[j]+pf[id-1]);
    		}
    	}
    	ans=min(ans,d[n-1]);
    	if(!next_permutation(p,p+n))
    		break;
    }
    if(ans==(int)1e18)ans=-1;
    cout << ans;
}


/****Bismillahir rahmanir rahim****/

#include<bits/stdc++.h>

using namespace std;

typedef long long            ll;
typedef long double          ld;
typedef vector<int>          vi;
typedef vector<long long>    vl;
typedef vector<double>       vd;

#define All(a) a.begin(),a.end()

template <typename T>
void get_vector(T &a)
{
    for(auto &e: a) cin >> e;
}

template <typename T>
void put_vector(T a)
{
    for(auto e :a)cout << e << " ";
    cout << endl;
}

int main()
{
    int n;
    cin >> n;
    vd a(n),b(n),c(n),d(n);
    int x = 0,y = 0;
    for(int i = 0 ;i <n; i++)
    {
        cin >> a[i]>>b[i];
        x += a[i];y += b[i];
        a[i]*=n;b[i]*=n;
    }
    for(int i = 0; i<n ; i++)
    {
        a[i] -= x; b[i]-= y;
    }x = 0, y = 0;
    for(int i = 0 ;i <n; i++)
    {
        cin >> c[i]>>d[i];
        x += c[i];y += d[i];
        c[i]*=n;d[i]*=n;
    }
    for(int i = 0; i<n ; i++)
    {
        c[i] -= x; d[i]-= y;
    }
    double X,Y;
    for(int i=0; i<n; i++){
        if(a[i]!=0 || b[i]!=0){
            swap(a[i],a[0]);
            swap(b[i],b[0]);
        }
    }
    X = a[0];
    Y = b[0];
   // put_vector(a); put_vector(b);put_vector(c);put_vector(d);
    //cout << "x = " << X << " Y = " << Y << endl;
    const double diff = 1e-6;
    string ans = "No";
    for(int i = 0; i <n;i++)
    {
        double angle = atan2(d[i],c[i]) - atan2(Y,X);
        bool ok = true;
        for(int j = 0; j<n; j++)
        {
            double cx = a[j]*cos(angle) - b[j]*sin(angle);
            double cy = a[j]*sin(angle) + b[j]*cos(angle);
            bool ok2 = false;
            for(int k = 0; k<n; k++)
            {
                if(abs(cx-c[k])<=diff&&abs(cy-d[k])<=diff)ok2 = true;
            }
            ok &= ok2;
        }

        if(ok)ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Erep(i,n) for(int i = 0; i <= (n); ++i)
#define repS(i,s,n) for(int i = s; i < (n); ++i)
#define ErepS(i,s,n) for(int i = s; i <= (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define RSort(a) sort(a.rbegin(), a.rend())
#define Output(a) printf("%lld %s", a, "\n")

typedef long long int ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vst;
typedef vector<double> vd;

const ll INF = 0x1fffffffffffffff;
const ll MOD = 1000000007;
const double PI = acos(-1);

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

ll n;
vd a, b, c, d;

void input(){
    cin >> n;
    a = vd(n);
    b = vd(n);
    c = vd(n);
    d = vd(n);
    rep(i, n) cin >> a[i] >> b[i];
    rep(i, n) cin >> c[i] >> d[i];
}

void solve(){
    string ans = "No";
    vd x(n), y(n);
    for(int k = 0; k < 360; k++){
        rep(i, n){
            double tx = a[i], ty = b[i];
            x[i] = tx * cos((k * PI ) / 180) - ty * sin((k * PI ) / 180);
            y[i] = tx * sin((k * PI ) / 180) + ty * cos((k * PI ) / 180);
        }
        double ave_s_x = 0, ave_s_y = 0, ave_t_x = 0, ave_t_y = 0;
        rep(i, n){
            ave_s_x += x[i];
            ave_s_y += y[i];
            ave_t_x += c[i];
            ave_t_y += d[i];
        }
        double diff_x = (ave_t_x - ave_s_x) / n;
        double diff_y = (ave_t_y - ave_s_y) / n;
        ll check = 1;
        rep(i, n){
            ll count = 0;
            rep(j, n){
                double ex = x[i] + diff_x, ey = y[i] + diff_y;
                //if(k == 90)
                //cout << ex << " " << c[j] << " " << ey << " " << d[j] << "\n";
                if(abs(ex - c[j]) <= (double) 0.05 && abs(ey - d[j]) <= (double) 0.05){
                  //cout << k << endl;
                  //cout << x[i] << " " << c[j] << " " << y[i] << " " << d[j] << "\n";
                    count++;
                }
            }
            if(count == 0){
                check = 0;
            }
        }
        if(check){
            ans = "Yes";
            break;
        }
    }
    cout << ans << endl;
}

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

    input();
    solve();
}


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

#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ittr(x,v) for(auto x=v.begin();x!=v.end();x++)
#define itpr(v) ittr(x,v) cout<<*x<<" "; cout<<"\n"
#define sz(x) (ll)((x).size())
#define all(v) v.begin(),v.end()

typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef map<ll,ll> ml;
typedef set<ll> sl;
typedef pair<ll,ll> pl;
typedef vector< pl > vpl;
typedef map<pl,ll> mpl;
typedef set< pl > spl;
typedef vector<string> vst;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vb> vvb;

ostream& operator<<(ostream& os, const pl &a){
    os<<a.first<<" "<<a.second;
    return os;
}

const ld pi=acosl(-1);
const ll INF=1000000000;
const ll INFF=1000000000000000000;
const ll M=1000000007;
const ll N=998244353;

/*--------------MAIN FUNCTION STARTS HERE--------------*/

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout
    ll n;
    cin>>n;
    ll cnt=0;
    ml ma;
    for(ll i=2;i*i<=n;i++){
        if(ma[i]) continue;
        ll m=i*i;
        while(m<=n){
            cnt++;
            ma[m]++;
            m*=i;
        }
    }
    cout<<n-cnt;
    return 0;
}

/*-----------------------------------------------------*/

/*

int t;
    cin>>t;
    while(t--){

    }

1. DO NOT RETURN 0 FROM WITHIN WHILE(T--) LOOP, USE CONTINUE
2. INT OVERFLOWS
3. ARRAY OVERFLOWS
4. '=' AND '=='
5. IF STD::BAD_ALLOC: CHECK INPUT REDIRECTION, CHECK IF ALL INPUTS WERE READ
6. 1<<N: NO, 1LL<<N: YES

*/

/* header file */
#include <bits/stdc++.h>
/* config */
namespace config {
__attribute__((constructor)) void _setup_ () noexcept {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout << std::fixed << std::setprecision(10);
}
} // namespace setup
/* iostream */
template<class Tp> std::istream &operator>> (std::istream &is, std::vector<Tp> &v) noexcept { for (Tp &x : v) is >> x; return is; }
template<class Tp> std::ostream &operator<< (std::ostream &os, const std::vector<Tp> &v) noexcept { std::cerr << '['; for (size_t i = 0; i < size(v); i++) { os << v[i]; if (i + 1 != size(v)) os << ' '; } std::cerr << ']'; return os; }
/* chmin / chmax */
template<class Tp, class Compare = std::greater<Tp>> constexpr bool chmin (Tp &a, const Tp &b, Compare comp = Compare{}) noexcept { if (comp(a, b)) { a = b; return true; } return false; }
template<class Tp, class Compare = std::less<Tp>> constexpr bool chmax (Tp &a, const Tp &b, Compare comp = Compare{}) noexcept { return chmin<Tp, Compare>(a, b, comp); }
/* zero judgement */
template<class Tp, Tp ZERO = Tp(0)> constexpr bool zero (const Tp &x) noexcept { return x == ZERO; }
template<class Tp, Tp ZERO = Tp(0), class... Args> constexpr bool zero (const Tp &x, const Args& ...args) noexcept { return zero(x) and zero(args...); }
/* python-like min / max */
template<class... Args> constexpr auto min (const Args&... args) noexcept { return std::min(std::initializer_list<std::common_type_t<Args...>>{args...}); }
template<class... Args> constexpr auto max (const Args&... args) noexcept { return std::max(std::initializer_list<std::common_type_t<Args...>>{args...}); }
/* python-like standard input */
template<class... Args> void input (Args&... args) noexcept { (std::cin >> ... >> args); }
/* python-like standard output */
void print () noexcept { std::cout << '\n'; }
template<class Tp, class... Args> void print (const Tp &first, const Args&... args) noexcept { std::cout << first; (std::cout << ... << (std::cout << ' ', args)); std::cout << '\n'; }
template<class Tp> void drop (const Tp &x) noexcept { std::cout << x << '\n'; std::exit(0); }
/* error output */
void error () noexcept { std::cerr << '\n'; }
template<class Tp, class... Args> void error (const Tp &first, const Args&... args) noexcept { std::cerr << first; (std::cout << ... << (std::cerr << ' ', args)); std::cerr << '\n'; }
template<class Tp> void dumpout (const Tp &x) noexcept { std::cerr << x << '\n'; std::exit(0); }
/* infinity class */
struct { template<class Tp> constexpr operator Tp() noexcept { return std::numeric_limits<Tp>::max() / 2; } constexpr auto operator- () noexcept; } infty;
struct { template<class Tp> constexpr operator Tp() noexcept { return std::numeric_limits<Tp>::lowest() / 2; } constexpr auto operator- () noexcept; } negative_infty;
constexpr auto decltype(infty)::operator- () noexcept { return negative_infty; }
constexpr auto decltype(negative_infty)::operator- () noexcept { return infty; }
/* alias */
template<class Tp> using matrix = std::vector<std::vector<Tp>>;
using i32 = std::int_fast32_t;
using u32 = std::uint_fast32_t;
using i64 = std::int_fast64_t;
using u64 = std::uint_fast64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

/*----------------------------------------------------------------------< template >----------------------------------------------------------------------*/

u32 read () {
	u32 value = 0;
	std::string s;
	std::cin >> s;
	for (const char &c : s) {
		if (c == '1') value++;
	}
	return (value & 1);
}

int main() {
	usize n, m;
	input(n, m);
	std::vector<u32> a(n);
	for (auto &e : a) e = read();
	std::array<u64, 2> count = {0, 0};
	u64 ans = 0;
	for (const auto &e : a) {
		ans += count[(e + 1) & 1];
		count[e]++;
	}
	print(ans);
	return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
#define rprintf(fmt, begin, end) do { const auto end_rp = (end); auto it_rp = (begin); for (bool sp_rp=0; it_rp!=end_rp; ++it_rp) { if (sp_rp) putchar(' '); else sp_rp = true; printf(fmt, *it_rp); } putchar('\n'); } while(0)

template<class T> struct Fenwick {
    int n;
    T* d;
    Fenwick() : n(0), d(NULL) {}
    Fenwick(int n_) : n(n_) {
	d = new T[n_]();
    }
    Fenwick(const Fenwick &y) : n(y.n) {
	d = new T[n];
	memcpy(d, y.d, sizeof (T) * n);
    }
    ~Fenwick() {
	delete[] d; d = NULL;
	n = 0;
    }
    friend void swap(Fenwick &x, Fenwick &y) {
	swap(x.n, y.n); swap(x.d, y.d);
    }
    Fenwick& operator=(Fenwick y) {
	swap(*this, y);
	return *this;
    }
    inline void add(int i, const T &x) {
	for (; i<n; i|=i+1) d[i] += x;
    }
    inline T sum(int r) const {
	T s = T();
	for (; r; r&=r-1) s += d[r-1];
	return s;
    }
    T sum(int l, int r) const {
	return sum(r) - sum(l);
    }
};
template<class T> void sort_unique(vector<T> &v) {
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
}
int N, M, Q;
VI A, B;

int T[200011];
int X[200011];
int Y[200011];

vector<pair<int, int> > Ys;
int get_idx(int val, int type) {
    auto it = lower_bound(Ys.begin(), Ys.end(), make_pair(val, type));
    assert(it != Ys.end());
    assert(it->first == val);
    assert(it->second == type);
    return it - Ys.begin();
}

void MAIN() {
    scanf("%d%d%d", &N, &M, &Q);
    A.resize(N, 0);
    B.resize(M, 0);
    REP (i, Q) {
	scanf("%d%d%d", T+i, X+i, Y+i);
	X[i]--;
    }

    Ys.emplace_back(0, 1);
    Ys.emplace_back(0, 2);

    REP (i, Q) {
	Ys.emplace_back(Y[i], T[i]);
    }

    sort_unique(Ys);

    Fenwick<int> FAC(Ys.size());
    Fenwick<int> FBC(Ys.size());
    Fenwick<LL> FAS(Ys.size());
    Fenwick<LL> FBS(Ys.size());

    assert(get_idx(0, 1) == 0);
    assert(get_idx(0, 2) == 1);

    FAC.add(get_idx(0, 1), N);
    FBC.add(get_idx(0, 2), M);

    LL ans = 0;

    REP (i, Q) {
	const int t = T[i];
	const int x = X[i];
	const int y = Y[i];

	if (t == 1) {
	    int from = get_idx(A[x], 1);
	    ans -= (LL) FBC.sum(from) * A[x];
	    ans -= FBS.sum(from, Ys.size());

	    FAC.add(from, -1);
	    FAS.add(from, -A[x]);

	    int to = get_idx(y, 1);
	    ans += (LL) FBC.sum(to) * y;
	    ans += FBS.sum(to, Ys.size());

	    FAC.add(to, 1);
	    FAS.add(to, y);

	    A[x] = y;
	} else {
	    int from = get_idx(B[x], 2);
	    ans -= (LL) FAC.sum(from) * B[x];
	    ans -= FAS.sum(from, Ys.size());

	    FBC.add(from, -1);
	    FBS.add(from, -B[x]);

	    int to = get_idx(y, 2);
	    ans += (LL) FAC.sum(to) * y;
	    ans += FAS.sum(to, Ys.size());

	    FBC.add(to, 1);
	    FBS.add(to, y);

	    B[x] = y;
	}

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

}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using VS = vector<string>;
using VC = vector<char>;
using Q = queue<int>;
using P = pair<int, int>;
using llP = pair<ll, ll>;

#define pb push_back

#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x
#define inn(x, y) int x,y;cin>>x>>y
#define innn(x, y, z) int x,y,z;cin>>x>>y>>z
#define bit(n) (1<<(n))

void _print(ostream&){}
template<class T,class...U>
void _print(ostream&s,const T&t,const U&...u){s<<t<<(sizeof...(u)?' ':'\n');_print(s,u...);}
template<class...T>
void out(const T&...t){_print(cout,t...);}
template<class...T>
void err(const T&...t){_print(cerr,t...);}
#define strictout(x, precision) cout<<fixed<<setprecision(precision)<<(x)<<endl

#define rep(i,n) for (int i=0;i<(n);i++)
#define repp(i,n) for (int i=1;i<=(n);i++)
#define reppp(j, i, n) for (int j=i+1; j<n; j++)

#define max5 100010
#define max9 1000000010

#define YesNo(x) cout<<(x?"Yes":"No")<<endl
#define YESNO(x) cout<<(x?"YES":"NO")<<endl
#define yesno(x) cout<<(x?"yes":"no")<<endl
#define yay(x) cout<<(x?"yay":":(")<<endl

#define deg(_rad) (((_rad)/2/M_PI)*360)
#define rad(_deg) (((_deg)/360)*2*M_PI)
#define mid(min, max) ((min + max) / 2)

int main() {
  inn(n, w);
  out(n / w);
  return 0;
}


/* dotp.cpp
 *
 *
 */

//#include "dotp.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <list>
#include <deque>
#include <cmath>

using namespace std;

int main()
{

    int n ;

    cin >> n ;
    vector<int> x(n, 0), y(n, 0) ;

    for(int i = 0; i < n; i++) cin >> x[i] ;
    for(int i = 0; i < n; i++) cin >> y[i] ;

    int sum = 0 ;
    for(int i = 0; i < n; i++) sum += (x[i] * y[i]) ;

    if( sum ) cout << "No" << endl ;
    else cout << "Yes" << endl ;

	return 0;
}

// Best practice

#include<bits/stdc++.h>

#define int         long long
#define pb          push_back
#define pf          emplace_front
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define pii 		pair<int,int>
#define psi 		pair<string,int>
#define vi 			vector<int>
#define vpii  		vector<pii>
#define vvi 		vector<vi>
#define sz(x)	    (int)(x).size()
#define x           first
#define y           second
#define endl        '\n'
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD         1000000007
#define hell        998244353
#define ini(a, i) 	memset(a, i, sizeof(a))
#define output(x)   cout << (x ? "YES" : "NO")<<endl;
using namespace std;

#define debug(vec) cout<<(#vec)<<" : [ "; for (auto& i: vec) cout<<i<<" "; cout<< "]" << endl
#define debugp(vec) cout<<(#vec)<<" : [ "; for (auto& i: vec) cout<<"("<<i.x<<","<<i.y<<")"<<" "; cout<< "]" << endl
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << "[" << *it << ": " << a << "]\t";
    err(++it, args...);
}

// const int dx[4] = { -1, 1, 0, 0};
// const int dy[4] = {0, 0, -1, 1};
// int dX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
// int dY[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
// bool valid(int x, int y, int n, int m){return (x>=0 && y>=0 && x<n && y<m);}

// Code from Here -------------------------------------------------------------------------------

void solver(){
	int n;
    cin >> n;
    int x;
    double ans1=0, ans2=0;
    int ans3=0;
    for(int i=0; i<n; i++){
        cin >> x;
        ans1 += abs(x);
        ans2 += (x*x);
        ans3 = max(ans3, abs(x));
    }
    cout << fixed << setprecision(15);
    cout << ans1 << endl;
    cout << sqrt(ans2) << endl;
    cout << ans3 << endl;
}

signed main() {
	tezz

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

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

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <cstdint>
#include <numeric>
#define INF 1000000000
#define LLINF 2000000000000000
#define MOD 1000000007
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define LOOP(i,N) for(int i=0;i<N;i++)
#define LOOP1(i,N) for(int i=1;i<=N;i++)
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
// #define int long long

signed main(){
  string s;
  cin >> s;
  int a[s.length()];
  int n = s.length();
  int sum = 0;
  int cnt[3] = {};
  LOOP(i,s.length()){
    a[i] = (s[i] - '0')%3;
    sum += a[i];
    cnt[a[i]%3]++;
  }
  int ans = -1;
  if(sum%3 == 0){
    ans = 0;
  }else{
    if(cnt[sum%3]){
      ans = 1;
    }else{
      int c = sum%3 == 2 ? 1 : 2;
      if(cnt[c] >= 2){
        ans = 2;
      }else{
        cerr << c << ":" << cnt[c] << endl;
        cout << -1 << endl;
        return 0;
      }
    }
  }

  if(n <= ans) {
    cout << -1 << endl;
  }else{
    cout << ans << endl;
  }
}

#include<bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x){
	x=0;char ch=getchar();bool f=false;
	while(!isdigit(ch)){if(ch=='-'){f=true;}ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	x=f?-x:x;
	return ;
}
template <typename T>
inline void write(T x){
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10^48);
	return ;
}
#define ll long long
const int N=2e5+5,M=1e8;
int n,m,q;
ll a[N],b[N];
struct SGTree{
	int cur,root;
	ll sum[N*80];
	int num[N*80],ls[N*80],rs[N*80];
	void Modify(int &x,int l,int r,int pos,int v,int tp){
		if(!x) x=++cur;
		int mid=l+r>>1;sum[x]+=v*tp;num[x]+=tp;
		if(l==r) return ;
		if(pos<=mid) Modify(ls[x],l,mid,pos,v,tp);
		else Modify(rs[x],mid+1,r,pos,v,tp);
		return ;
	}
	ll QuerySum(int x,int l,int r,int ql,int qr){
		if(ql>qr||!x) return 0;
		if(ql<=l&&r<=qr) return sum[x];
		int mid=l+r>>1;ll res=0;
		if(ql<=mid) res+=QuerySum(ls[x],l,mid,ql,qr);
		if(qr>mid) res+=QuerySum(rs[x],mid+1,r,ql,qr);
		return res;
	}
	int QueryNum(int x,int l,int r,int ql,int qr){
		if(ql>qr||!x) return 0;
		if(ql<=l&&r<=qr) return num[x];
		int mid=l+r>>1,res=0;
		if(ql<=mid) res+=QueryNum(ls[x],l,mid,ql,qr);
		if(qr>mid) res+=QueryNum(rs[x],mid+1,r,ql,qr);
		return res;
	}
}t1,t2;
ll Ans;
int main(){
	read(n),read(m),read(q);
	for(int i=1;i<=n;i++) t1.Modify(t1.root,0,M,a[i],a[i],1);
	for(int i=1;i<=m;i++) t2.Modify(t2.root,0,M,b[i],b[i],1);
//	for(int i=1;i<=n;i++){
//		Ans+=1ll*t2.QueryNum(t2.root,0,M,1,a[i])*a[i];
//		Ans+=1ll*t2.QuerySum(t2.root,0,M,a[i]+1,M);
//	}
	for(int i=1;i<=q;i++){
		int op,pos;ll v;
		read(op),read(pos),read(v);
		if(op==1){
			Ans-=1ll*t2.QueryNum(t2.root,0,M,0,a[pos])*a[pos];
			Ans-=1ll*t2.QuerySum(t2.root,0,M,a[pos]+1,M);
			t1.Modify(t1.root,0,M,a[pos],a[pos],-1);

			a[pos]=v;
			Ans+=1ll*t2.QueryNum(t2.root,0,M,0,a[pos])*a[pos];
			Ans+=1ll*t2.QuerySum(t2.root,0,M,a[pos]+1,M);
			t1.Modify(t1.root,0,M,a[pos],a[pos],1);
		}
		else{
			Ans-=1ll*t1.QueryNum(t1.root,0,M,0,b[pos])*b[pos];
			Ans-=1ll*t1.QuerySum(t1.root,0,M,b[pos]+1,M);
			t2.Modify(t2.root,0,M,b[pos],b[pos],-1);
			b[pos]=v;
			Ans+=1ll*t1.QueryNum(t1.root,0,M,0,b[pos])*b[pos];
			Ans+=1ll*t1.QuerySum(t1.root,0,M,b[pos]+1,M);
			t2.Modify(t2.root,0,M,b[pos],b[pos],1);
		}
		write(Ans),putchar('\n');
	}
	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef float flt;

#define for0(i, n) for(ll i=0; i<n; i++)
#define for1(i, n) for(ll i=1; i<=n; i++)
#define forab(i, a, b) for(ll i=a; i<=b; i++)
#define clr0(a) memset(a, 0, sizeof(a))

ll SubseqWidths(ll A[], ll n) {
    sort(A, A + n);
    ll pow2[n];
    pow2[0] = 1;
    for (ll i=1; i<n; ++i) {
        pow2[i] = (pow2[i - 1] * 2) % 998244353;
    }
    int ans = 0;
    for (ll i=0; i<n; ++i) {
        ans = (ans + (pow2[i] * pow2[n - 1 - i]) * A[i]) % 998244353;
    }
    for0(i, n) {
        ans += (A[i]*A[i]) % 998244353;
    }
    ans -= A[0];
    return ans;
}

void solve() {
    ll n;
    cin >> n;
    ll a[n+10];
    ll ans = 0;
    for0(i, n) {
        cin >> a[i];
        ans += (a[i]*a[i]) % 998244353;
    }
    //cout << SubseqWidths(a, n) << endl;;
    sort (a, a+n);
    ll mul[n+10];
    mul[0] = a[0];
    for1(i, n-1) {
        mul[i] = (2*mul[i-1] + a[i]) % 998244353;
    }
    //ll ans = 0;
    //for0(i, n) {
    //    cout << mul[i] << " ";
    //}
    //cout << endl;
    for0(i, n) {
        if (i>0) {
            ans += (a[i]*mul[i-1]) % 998244353;
        }
    }
    ans = ans % 998244353;
    cout << ans << endl;

}

void testcase() {
    ll t;
    cin >> t;
    while (t--) {
        solve();
    }
}

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

    //testcase();
    solve();

    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
#include <list>
#include <type_traits>
#include<fstream>
using namespace std;
#define INF ((1<<30)-1)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()

int sy, sx;
uint32_t t[50][50];
int p[50][50];

struct State{
	char op;
	int prev_st;
	int y, x;
	int score;

	int sumy, sumx;
	int moment;

	long long vis[30];

	State(int sy, int sx, uint32_t t_id, int sc) {
		op = 'x';
		prev_st = -1;
		y = sy;
		x = sx;
		sumx = sumy = 0;
		score = sc;
		moment = 0;
		memset(vis, 0, sizeof(vis));
		vis[t_id / 64] |= 1LL << t_id % 64;
	}

	State(const State &st, int prev, char op, int dy,int dx) {
		*this = st;
		this->op = op;
		prev_st = prev;
		y += dy;
		x += dx;
		score += p[y][x];
		sumy += dy;
		sumx += dx;
		int a = min(sumx, sumy);
		int b = max(sumx, sumy);
		moment = b * b - a * a;
		uint32_t t_id = t[y][x];
		vis[t_id / 64] |= 1LL <<  t_id % 64;
	}
	State(const State& st, int prev) {
		*this = st;
		this->op = 'x';
		prev_st = prev;
		sumy = sumx = 0;
		moment = 0;
	}

	bool ok(int ny, int nx) const {
		if (0 <= ny && ny < 50 && 0 <= nx && nx < 50) {
			uint32_t t_id = t[ny][nx];
			return (vis[t_id / 64] >> t_id % 64 & 1) == 0;
		}
		return false;
	}

	bool operator<(const State& s) const {
		int a = 10 * score + 2000 * moment;
		int b = 10 * s.score + 2000 * s.moment;
		return a > b;
	}
};

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

#if defined(_MSC_VER)
	ifstream input("in.txt");
#else
	auto& input = cin;
#endif

	input >> sy >> sx;
	rep(i, 50)rep(j, 50)input >> t[i][j];
	rep(i, 50)rep(j, 50)input >> p[i][j];

	vector<vector<State>> sts;
	sts.emplace_back();
	sts.back().emplace_back(sy, sx, t[sy][sx], p[sy][sx]);

	rep(i, 1200) {
		if (sts.back().empty()) break;
		sts.emplace_back();
		//cerr << i << endl;

		sort(all(sts[i]), [](const State& a, const State& b) {return a.score > b.score; });
		sts[i].erase(unique(all(sts[i]), [](const State& a, const State& b) {return a.score == b.score; }), sts[i].end());
		int width = min<int>(1200, sts[i].size());
		nth_element(sts[i].begin(), sts[i].begin() + width, sts[i].end());

		rep(j, width) {
			const State& st = sts[i][j];
			if (st.ok(st.y - 1, st.x))
				sts.back().emplace_back(st, j, 'U', - 1, 0);
			if (st.ok(st.y + 1, st.x))
				sts.back().emplace_back(st, j, 'D', 1, 0);
			if (st.ok(st.y, st.x - 1))
				sts.back().emplace_back(st, j, 'L', 0, -1);
			if (st.ok(st.y, st.x + 1))
				sts.back().emplace_back(st, j, 'R', 0, 1);
			sts.back().emplace_back(st, j);

			//cerr << st.score << endl;
		}
	}

	int best_i = 0, best_j = 0, best_score = 0;
	rep(i, sts.size()){
		rep(j, sts[i].size()) {
			if (best_score < sts[i][j].score) {
				best_score = sts[i][j].score;
				best_i = i;
				best_j = j;
			}
		}
	}
	//cerr << best_i << endl;
	cerr << best_score << endl;

	string answer;
	while (best_i) {
		if (sts[best_i][best_j].op != 'x')answer += sts[best_i][best_j].op;
		best_j = sts[best_i][best_j].prev_st;
		best_i--;
	}
	reverse(all(answer));
	cout << answer << endl;

	return 0;
}


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

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

#define mp make_pair
#define pb push_back
#define pob pop_back
#define all(x) (x).begin(),(x).end()
#define ll long long
#define ld long double
#define endl "\n"
#define ff first
#define ss second
#define imn INT_MIN
#define imx INT_MAX

ld pi=3.14159265358979323846;

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...) 20
#endif

ll mod=1e9+7;
vector<ll> seg,fac;
ll power(ll a,ll b,ll m)
{
    a%=m;
    if(b==1)
    return a;
    if(b==0)
    return 1LL;
    ll ret=power(a,b/2,m);
    ret=(ret*ret)%m;
    if(b&1)
    ret=(ret*a)%m;
    return ret;
}

ll power(ll a,ll b)
{
    if(b==1)
    return a;
    if(b==0)
    return 1LL;
    ll ret=power(a,b/2);
    ret=(ret*ret);
    if(b&1)
    ret=(ret*a);
    return ret;
}

ll lcm(ll a,ll b)
{
    return (a*b)/(__gcd(a,b));
}

ll phi(ll n) // Euler-Totient Function
{
    ll result = n;
    for(ll i=2;i*i<=n;i++)
    {
        if (n%i==0)
        {
            while (n%i==0)
            n/=i;
            result/=i;
            result*=(i-1);
        }
    }
    if (n > 1)
    {
        result/=n;
        result*=(n-1);
    }
    return result;
}

ll findpar(ll x,vector<ll> par)
{
    while(x!=par[x])
    {
        x=par[x];
    }
    return x;
}

ll construct(ll a[],ll s,ll e,ll i)
{
    if(s==e)
    {
        seg[i]=a[s];
        return seg[i];
    }
    ll mid=s+(e-s)/2;
    seg[i]=construct(a,s,mid,2*i+1)^construct(a,mid+1,e,2*i+2);
    return seg[i];
}

void update(ll node,ll val,ll s,ll e,ll i)
{
    if(s==e)
    {
        seg[i]=val;
        return;
    }
    ll mid=s+(e-s)/2;
    if(node<=mid)
    {
        update(node,val,s,mid,2*i+1);
    }
    else
    {
        update(node,val,mid+1,e,2*i+2);
    }
    seg[i]=seg[2*i+1]^seg[2*i+2];
}

ll query(ll l,ll r,ll s,ll e,ll i)
{
    if(e<l || s>r)
    return 0;
    if(s>=l && e<=r)
    return seg[i];
    ll mid=s+(e-s)/2;
    return (query(l,r,s,mid,2*i+1)^query(l,r,mid+1,e,2*i+2));
}

void computeFac(ll mx)
{
    fac.resize(mx+10);
    fac[0]=1;
    for(ll i=1;i<mx+10;i++)
    {
        fac[i]=(fac[i-1]*i)%mod;
    }
}

ll ncr(ll a,ll b)
{
    if(a<b || b<0)
    return 0;
    ll x=(fac[a-b]*fac[b])%mod;
    return (fac[a]*power(x,mod-2,mod))%mod;
}

void answer_nikaal()
{
    ll a,b,c;
    cin>>a>>b>>c;
    if(a*a+b*b<c*c)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}

int main()
{
    make_it_fast;
    int TEST_CASES=1;
    // cin>>TEST_CASES;
    while(TEST_CASES--)
    {
        answer_nikaal();
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <cassert>

using namespace std;

vector<int> opos(const string& s) {
    int n = s.length();
    vector<int> ps;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '1') ps.push_back(i);
    }
    return ps;
}

void solve() {
    int n;
    string s, t;
    cin >> n >> s >> t;

    if (count(s.begin(), s.end(), '0') !=
        count(t.begin(), t.end(), '0')) {
        cout << "-1\n";
        return;
    }

    int ans = 0;
    for (int q = 0; q < 2; ++q) {
        auto sps = opos(s), tps = opos(t);
        int m = sps.size();

        int p = 0;
        for (int i = 0; i < m; ++i) {
            auto& si = sps[i];
            auto ti = tps[i];

            si = max(si, p);
            if (si < ti) {
                ans += ti - si;
                si = ti;
            }
            p = si + 1;
        }

        reverse(s.begin(), s.end());
        reverse(t.begin(), t.end());
    }

    cout << ans << "\n";
}

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

    solve();

    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <iomanip>
#include <functional>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <map>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define rep(i,n) for (ll i = 0; i < (ll)(n); i++)
#define REP(i,n) for (ll i = 1; i <= (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define vt vector
#define fcout cout<<fixed<<setprecision(15)
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923078160628620899
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll INF = 1000000000000000000;
const ll NIL = -1;
const ll dx[4] = { 0,1,0,-1 };
const ll dy[4] = { 1,0,-1,0 };

ll N;
ll dist[200010];
tuple<ll, ll, ll> U[100010];
vector<pair<ll,ll>> adj[200010];

void dfs(ll x, uint64_t d) {
	for (auto u : adj[x]) {
		if (dist[u.first] == -1) {
			ll p = d ^ u.second;
			dist[u.first] = p;
			dfs(u.first, p);
		}
	}
}

int main() {
	cin >> N;
	rep(i, N - 1) {
		ll A, B;
		ll C;
		cin >> A >> B >> C;
		A--; B--;
		pair<ll, ll> As = { B,C }, Bs = { A,C };
		adj[A].pb(As);
		adj[B].pb(Bs);
	}
	dist[0] = 0;
	for (ll i = 1; i < N; i++) dist[i] = -1;
	dfs(0, 0);
	ll ANS = 0;
	ll now = 1;
	for (ll i = 0; i < 60; i++) {
		ll cnt = 0;
		for (ll j = 0; j < N; j++) {
			if (dist[j] % 2 == 1) cnt++;
			dist[j] /= 2;
		}
		ll plus = cnt * (N - cnt);
		plus %= MOD;
		plus *= now;
		plus %= MOD;
		ANS += plus;
		ANS %= MOD;
		now *= 2;
		now %= MOD;
	}
	cout << ANS << endl;
	return 0;
}

#include<bits/stdc++.h>
#define ff first
#define ss second
#define ll long long
#define pb push_back
using namespace std;

const int maxn=2e5+10;
const int mb=60;
vector<pair<int,ll> >vect[maxn];
ll dp[maxn][mb][2],rez,mod=1e9+7;

void go(int x,int prv){

    for(int i=0;i<vect[x].size();i++){

        int id=vect[x][i].ff;
        ll w=vect[x][i].ss;
        if(id==prv)continue;
        go(id,x);

        for(int j=0;j<mb;j++){

            if((1ll<<(j))&w)swap(dp[id][j][0],dp[id][j][1]);

            rez=(rez+((1ll<<j)%mod)*dp[id][j][1] )%mod;

            rez=(rez+((((1ll<<j)%mod)*dp[x][j][1])%mod)*dp[id][j][0] )%mod;
            rez=(rez+((((1ll<<j)%mod)*dp[x][j][0])%mod)*dp[id][j][1] )%mod;

            dp[x][j][0]+=dp[id][j][0];
            dp[x][j][1]+=dp[id][j][1];
        }

    }
    for(int j=0;j<mb;j++)
    dp[x][j][0]++;
}

int main(){

    ///freopen("test.txt","r",stdin);

    int n;
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        int u,v;
        ll w;
        scanf("%d %d %lld",&u,&v,&w);
        vect[u].pb({v,w});
        vect[v].pb({u,w});
    }

    go(1,0);

    printf("%lld\n",rez);

return 0;
}


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

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

#define rep(i, n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i, s, n) for(long long i=(s);i<(long long)(n);i++)
#define repi(i, n) for(int i=0;i<(int)(n);i++)
#define rep2i(i, s, n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define chmax(s, t) s=max(s,t);
#define chmin(s, t) s=min(s,t);

#define deg2rad(deg) (((deg)/360)*2*M_PI)
#define rad2deg(rad) (((rad)/2/M_PI)*360)

using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

const ll INF = (1LL<<60);
const int INFi = (1<<29);

/*素数判定*/
bool is_prime(ll n){
    if(n==1) return false;
    for(ll i=2;i*i<=n;i++){
        if(n%i==0) return false;
    }
    return true;
}

/*約数列挙*/
vll enum_divisors(ll n){
    vll l;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            l.push_back(i);
            if(n/i != i) l.push_back(n/i);
        }
    }
   sort(all(l));
   return l;
}

/*素因数分解*/
vector<P> prime_factorize(ll n){
    vector<P> l;
    for(ll i=2;i*i<=n;i++){
        if(n%i!=0) continue;
        ll e = 0;
        while(n%i==0){
            e++;
            n /= i;
        }
        l.push_back({i, e});
    }
    if(n!=1) l.push_back({n, 1});
    return l;
}

/*最小公倍数*/
ll lcm(ll a, ll b){
    return a*b/__gcd(a,b);
}

/*最大公約数*/
ll gcd(ll a, ll b){
    return __gcd(a,b);
}

/*組み合わせ(Combination)*/
const ll CMAX = 1010000;
const ll CMOD = 1e9+7;
ll fac[CMAX], finv[CMAX], inv[CMAX];
// テーブルを作る前処理
void combinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < CMAX; i++) {
		fac[i] = fac[i - 1] * i % CMOD;
		inv[i] = CMOD - inv[CMOD%i] * (CMOD / i) % CMOD;
		finv[i] = finv[i - 1] * inv[i] % CMOD;
	}
}
// 二項係数計算
ll comb(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % CMOD) % CMOD;
}

/*階乗*/
ll factorial(ll n){
    const ll FMOD = 1e9+7;
    ll ret = n;
    for(ll i=n-1;i>0;i--){
        ret*=i;
        ret%=FMOD;
    }
    return (ret?ret:1);
}

int main(){

    ll n; cin >> n;

    ll ans = 0;
    if(n<1e3){
        ans = 0;
        cout << ans << endl;
        return 0;
    }
    if(n<1e6){
        ans += 1 * (n - (1e3-1));
        cout << ans << endl;
        return 0;
    }
    if(n<1e9){
        ans += 1 * ((1e6-1) - (1e3-1));
        ans += 2 * (n - (1e6-1));
        cout << ans << endl;
        return 0;
    }
    if(n<1e12){
        ans += 1 * ((1e6-1) - (1e3-1));
        ans += 2 * ((1e9-1) - (1e6-1));
        ans += 3 * (n - (1e9-1));
        cout << ans << endl;
        return 0;
    }
    if(n<1e15){
        ans += 1 * ((1e6-1) - (1e3-1));
        ans += 2 * ((1e9-1) - (1e6-1));
        ans += 3 * ((1e12-1) - (1e9-1));
        ans += 4 * (n - (1e12-1));
        cout << ans << endl;
        return 0;
    }
    if(n<1e18){
        ans += 1 * ((1e6-1) - (1e3-1));
        ans += 2 * ((1e9-1) - (1e6-1));
        ans += 3 * ((1e12-1) - (1e9-1));
        ans += 4 * ((1e15-1) - (1e12-1));
        ans += 5 * (n - (1e15-1));
        cout << ans << endl;
        return 0;
    }

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int sz = 2e5+5;
ll int arr[sz]={0},arr1[sz]={0},arr2[sz]={0}, id[sz];
char arrc[205][205];
int arrtd[205][205] = {0};
bool visited[50000],visited1[50000];
int prime[10005]= {0};
vector <ll int> vec,vec1,vec2,vecc[sz];
vector<pair<ll int, ll int>> vecp,vecp1;
set<ll int> st;
vector<ll int> edges[50000], cost[50000];
ll int len[50000];
map<int,int> mp;
//queue<ll int> Q;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define INF 1e9

int main()
{
    ll int n;
    cin>>n;
    ll int sum =0;
    if(n>=1000) sum+= n-999;
    if(n>=1000000) sum+=n-999999;
    if(n>=1000000000) sum+=n-999999999;
    if(n>=1000000000000) sum+=n-999999999999;
    if(n>=1000000000000000) sum+=n-999999999999999;

    cout<<sum<<"\n";
}


#include <iostream>

#include <vector>
#include <string>

#include <algorithm>
#include<cmath>

using namespace std;

int main(void){
  vector<double> start(2);
  vector<double> goal(2);
  double ans;
  cin >> start[0];
  cin >> start[1];
  cin >> goal[0];
  cin >> goal[1];
  ans = start[0] + (goal[0] - start[0])*start[1]/(start[1]+ goal[1]);

  printf("%.17lf",ans);
  return 0;
}

#include <bits/stdc++.h>
#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 FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
using namespace std;
using ll = long long;
const ll MOD = 1000000007LL;
//const ll MOD = 998244353LL;
int pmod(int x){int y=x%(int)MOD;return (y>=0)?y:y+(int)MOD;}
ll pmod(ll x){ll y=x%MOD;return (y>=0LL)?y:y+MOD;}

int main(){
    double sx, sy, gx, gy;
    cin>>sx>>sy>>gx>>gy;
    printf("%.020lf", (sx*gy+sy*gx)/(sy+gy));
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int M=1e9+7;
int n;
double fi, x, man, euc, che;
int main() {
	cin >> n;
	while (n--) {
	    cin >> x;
	    fi=abs(x);
	    man+=fi;
	    euc+=fi*fi;
	    che=max(che, fi);
	}
	cout << fixed << setprecision(10) << man << endl << sqrt(euc) << endl << che;
}

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1e17;
const int inf = 1e5;
typedef long double ld;
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; }
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
struct SegmentTree{
  int N;
  vector<int> node;
  public :
    void intit(vector<int>v){
      int sz = v.size();
      N=1;
      while(N<sz) N*=2;
      node.resize(N);
      for(int i=0 ; i<sz ; i++) node[i+N-1] = v[i];
      for(int i=N-2 ; i>=0 ; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
    void update(int x, int val){
      x += N-1;
      node[x+N-1] = val;
      while(x>0){
        x = (x-1)/2;
        node[x] = min(node[x*2+1], node[x*2+2]);
      }
    }
    int getmin(int a, int b, int k, int l, int r){
      if(b<=l || r<=a) return inf;
      else if(a<=l && r<=b) return node[k];
      else{
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
      }
    }
};
vector<ll> divisor(ll n){
  vector<ll> res;
  for(ll i=1; i*i<=n ; i++){
    while(n%i==0){
      ++res[i];
      n /= i;
    }
  }
  if(n!=1) res[n]=1;
  return res;
}
int main(){
  int N;  cin>>N;
  vector<ll> v(N);
  rep(i,0,N) cin>>v[i], v[i]=abs(v[i]);
  ll now = 0;
  rep(i,0,N) now+=v[i];
  cout<<now<<endl;
  now=0;
  rep(i,0,N) now+=v[i]*v[i];
  printf("%.9f\n", sqrt(now));
  now = -INF;
  rep(i,0,N) chmax(now, v[i]);
  cout<<now<<endl;
  return 0;
}


#include <bits/stdc++.h>
#define clog(x) std::clog << (#x) << " is " << (x) << '\n';
using LL = long long;

const int N = 2002;
struct Edge {
	int to;
	LL c, d;
	Edge(int x, LL y, LL z) : to(x), c(y), d(z) {}
};
const LL INF = 1e18;
int main() {
	//freopen("in", "r", stdin);
	std::cin.tie(nullptr)->sync_with_stdio(false);
	int cas = 1;
	// std::cin >> cas;
	while (cas--) {
		int n, m;
		std::cin >> n >> m;
		std::vector<std::vector<Edge>> e(n);
		for (int i = 0, u, v; i < m; ++i) {
			LL c, d;
			std::cin >> u >> v >> c >> d;
			if (--u == --v) continue;
			e[u].emplace_back(v, c, d);
			e[v].emplace_back(u, c, d);
		}
		auto f = [&](LL c, LL d, LL t) -> LL {
			int sn = std::sqrt(d);
			if (t > sn) return c + t + d / (t + 1);
			return c + sn + d / (sn + 1);
		};
		std::vector<LL> dist(n, INF);
		dist[0] = 0;
		std::priority_queue<std::pair<LL, int>> Q;
		Q.push({0, 0});
		while (!Q.empty()) {
			auto [du, u] = Q.top();
			Q.pop();
			if (du != -dist[u]) continue;
			for (auto [v, c, d] : e[u]) {
				LL now = f(c, d, -du);
				if (dist[v] > now) {
					dist[v] = now;
					Q.push({-now, v});
				}
			}
		}
		std::cout << (dist[n - 1] == INF ? -1 : dist[n - 1]) << '\n';
	}
	return 0;
}

#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;
typedef pair<int,int> pii;
typedef pair<long long int,long long int> plli;
typedef vector< vi > vvi ;
typedef vector< vlli > vvlli  ;
#define fi(i,a,b) for(int i=a;i<=b;i++)
#define flli(i,a,b) for(long long int i=a;i<=b;i++)
#define bi(i,a,b) for(int i=a;i>=b;i--)
#define blli(i,a,b) for(long long int i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define pi 2*acos(0.0)
#define pb push_back
#define tr(v,it) for(decltype(v.begin()) it=v.begin();it!=v.end();it++)
#define present(v,num) (v.find(num)!=v.end())
#define cpresent(v,num) (find(v.begin(),v.end(),num)!=v.end())
#define pq priority_queue
#define mp make_pair
const int inf=INT_MAX;
const lli INF =LLONG_MAX;
const lli mod = 1e9+7;
lli ternarysearch(lli currt,lli di)
{
	lli var=sqrt(di);
	currt=max(var,currt);
	return currt;
	lli l=currt,r=di;
	while(r-l>3)
	{
		lli mid1=l+(r-l)/3;
		lli mid2=r-(r-l)/3;
		lli val1=di/(mid1+1)+mid1;
		lli val2=di/(mid2+1)+mid2;
		if(val1<val2)
		{
			r=mid2;
		}
		else if(val1>val2)
		{
			l=mid1;
		}
		else
		{
			l=mid1;
			r=mid2;
		}
	}
	lli mini=INF;
	lli finalt=currt;
	flli(i,l,r)
	{
		lli val=di/(i+1)+i;
		if(val<mini)
		{
			mini=val;
			finalt=i;
		}
	}
	return finalt;
}
int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast;
    lli n,m;cin>>n>>m;
    vector<plli> costs(m);
    vector<vector<plli> > graph(n);
    flli(i,0,m-1)
    {
    	lli ui,vi;cin>>ui>>vi;
    	ui--;
    	vi--;
    	graph[ui].pb(mp(vi,i));
    	graph[vi].pb(mp(ui,i));
    	cin>>costs[i].first>>costs[i].second;
    }
    vlli finalcosts(n,INF);
	finalcosts[0]=0;
	priority_queue<plli,vector<plli>,greater<plli> > q;
	q.push(mp(0,0));
	while(!q.empty())
	{
		plli topi=q.top();
		q.pop();
		if(finalcosts[topi.second]!=topi.first)continue;
		tr(graph[topi.second],it)
		{
			lli opttime=ternarysearch(topi.first,costs[it->second].second);
			lli currcost=costs[it->second].first+(costs[it->second].second/(opttime+1))+opttime;
			if(finalcosts[it->first]>currcost)
			{
				finalcosts[it->first]=currcost;
				q.push(mp(finalcosts[it->first],it->first));
			}
		}
	}
	if(finalcosts[n-1]==INF)
	{
		cout<<-1;
	}
	else cout<<finalcosts[n-1];
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i, a, b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)

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

    REP(i, K) {
        if(stoll(N) % 200 == 0) {
            N = to_string(stoll(N) / 200);
        }
        else {
            N = N + "200";
        }
    }

    cout << N << endl;

    return 0;
}

#include <iostream>
using namespace std;

int main(){
    long long n;
    int k;
    cin >> n >> k;
    for(int i=0; i<k; i++){
        if(n%200==0){
            n /= 200;
        }else{
            n = n*1000 + 200;
        }
    }
    cout << n << endl;
}


#include <bits/stdc++.h>
typedef long long ll;
#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 INF 1000000000000 //10^12:∞
#define MOD 1000000007

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

using namespace std;

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    if(a==b){
        cout << x;
        return 0;
    }else if(a<b){
        if(y<=2*x){
            cout << x+(b-a)*y;
            return 0;
        }else{
            cout << x+2*x*(b-a);
            return 0;
        }
    }else{
        if(y<=2*x){
            cout << x+(a-b-1)*y;
            return 0;
        }else{
            cout << x+(a-b-1)*2*x;
            return 0;
        }
    }

}

#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<climits>
#include<cmath>
#include<cstring>
#include<deque>
#include<functional>
#include<iostream>
#include<iomanip>
#include<map>
#include<numeric>
#include<optional>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<tuple>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#pragma GCC optimize("Ofast")
namespace gengar
{
	using namespace std;
	#define int long long
	#define itn int
	#define uint unsigned long long
	#define ld long double
	#define vt(tp) vector<tp>
	#define vvt(tp) vector<vector<tp>>
	#define vvt2(nm,tp,h,w,n) vector<vector<tp>>nm((h),vector<tp>(w,n))
	#define P pair<int,int>
	#define hmap unordered_map
	#define hset unordered_set
	#define all(x) x.begin(),x.end()
	#define nsort(x) sort(all(x))
	#define rsort(x) nsort(x);reverse(all(x))
	#define unq(v) v.erase(unique(all(v)),v.end())
	#define l_b(c,x) distance(c.begin(),lower_bound(all(c),(x)))
	#define u_b(c,x) distance(c.begin(),upper_bound(all(c),(x)))
	#define fi first
	#define se second
	#define mp make_pair
	#define pb push_back
	#define eb emplace_back
	#define spc ' '
	#define pass
	#define _overload3(_1,_2,_3,name,...) name
	#define _rep(i,n) repi(i,0,n)
	#define repi(i,a,b) for(int i=(a),__SIZE##_=(b);i<__SIZE##_;i++)
	#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
	#define _daolrevo3(_1,_2,_3,name,...) name
	#define _per(i,n) peri(i,n,0)
	#define peri(i,a,b) for(int i=(a),__SIZE##_=(b);i>=__SIZE##_;i--)
	#define per(...) _daolrevo3(__VA_ARGS__,peri,_per,)(__VA_ARGS__)
	#define Bit(n) (1LL<<(n))
	#define myceil(a,b) ((a)+((b)-1))/(b)
	#define scale(n) cout<<fixed<<setprecision(n)
	using i64=int64_t;
	using u64=uint64_t;
	template<class T>using PQ=priority_queue<T,vt(T),greater<T>>;
	void in(){}
	template<class Car,class...Cdr>
	void in(Car&&car,Cdr&&...cdr){cin>>car;in(forward<Cdr>(cdr)...);}
	template<class T>void drop(T x){cout<<(x)<<endl;exit(0);}
	void dYes(){puts("Yes");exit(0);}
	void dNo(){puts("No");exit(0);}
	int gcd(int a,int b){return b?gcd(b,a%b):a;}
	int lcm(int a,int b){return a/gcd(a,b)*b;}
	int fact(int n,int m){int f=n;for(int i=n-1;i>=1;i--){f*=i;f%=m;}return f;}
	template<class T>int chmin(T&a,const T&b){if(b<a){a=b;return 1;}return 0;}
	template<class T>int chmax(T&a,const T&b){if(a<b){a=b;return 1;}return 0;}
	const int inf=Bit(60);
	const double pi=acos(-1);
	const int mod=1000000007;//998244353
};
using namespace gengar;

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,k;cin>>n>>k;
	vector<P>ab(n);
	rep(i,n)cin>>ab[i].first>>ab[i].second;
	sort(all(ab));
	int now=0,old=0;
	for(auto p:ab)
	{
		now=p.first;
		k=k+old-p.first;
	//	cout<<now<<' '<<k<<endl;
		if(k<0){cout<<now+k<<endl;exit(0);}
		k=k+p.second;
		old=p.first;
	}
	cout<<now+k<<endl;
	return 0;
}