#include<iostream>
using namespace std;
long N,M,mod=998244353;
long F[1<<25],I[1<<25];
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
long C(long a,long b)
{
	return a<b||a<0||b<0?0:F[a]*I[b]%mod*I[a-b]%mod;
}
long H(long a,long b){return a<0?0:C(a+b-1,b-1);}
long calc(long n,long m,long s)
{
	long ret=0;
	for(int i=0;i<=n&&i<=m;i++)
	{
		if(s-i&1)continue;
		(ret+=C(n,i)*H((s-i)/2,n)%mod)%=mod;
	}
	return ret;
}
main()
{
	cin>>N>>M;
	long T=2*M+N;
	F[0]=1;
	for(long i=1;i<T;i++)F[i]=F[i-1]*i%mod;
	I[T-1]=power(F[T-1],mod-2);
	for(long i=T-1;i--;)I[i]=I[i+1]*(i+1)%mod;
	long ans=0;
	for(int i=0;i<=N&&i<=M;i++)
	{
		if((3*M-i)%2==1)continue;
		(ans+=C(N,i)*H((3*M-i)/2,N)%mod)%=mod;
	}
	long ret=0;
	for(int i=0;i<=N&&i<=M;i++)
	{
		if((M-i)%2==1)continue;
		(ret+=C(N,i)*H((M-i)/2,N)%mod)%=mod;
	}
	for(int i=0;i<=N-1&&i<=M;i++)
	{
		if((M-i)%2==1)continue;
		(ret+=mod-C(N-1,i)*H((M-i)/2,N-1)%mod)%=mod;
	}
	cout<<(calc(N,M,3*M)-calc(N,M,M)*N%mod+calc(N-1,M,M)*N%mod+mod)%mod<<endl;
}

#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for (int i = (a); i < (b); i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;

ll mpow(ll a, ll b) {
	ll res = 1;
	a %= mod;
	while (b) {
		if (b & 1) res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return res;
}
vector<int> fac, finv;
void factor(int N) {
	fac.resize(N); finv.resize(N);
	fac[0] = finv[0] = 1;
	rep(i, 1, N)fac[i] = 1LL * fac[i - 1] * i % mod;
	finv[N - 1] = mpow(fac[N - 1], mod - 2);
	for (int i = N - 2; i; --i) finv[i] = 1LL * finv[i + 1] * (i + 1) % mod;
}
int nCr(int n, int m) {
	if (m < 0 || n < m) return 0;
	return 1LL * (1LL * fac[n] * finv[m] % mod) * finv[n - m] % mod;
}

int main() {
	int n, a, b, c, d; cin >> n >> a >> b >> c >> d;
	factor(200010);
	vector<vector<ll>> dp(n+10);
	rep(i, 0, n + 10) dp[i].resize(n + 10, 0);
	dp[0][0] = 1;
	rep(i, 0, n + 1)rep(j, 0, b - a + 2) {
		int idx = a + j;
		dp[i][j + 1] = (dp[i][j + 1] + dp[i][j]) % mod;
		rep(k, c, d + 1) {
			int sum = idx * k + i;
			if (sum > n) break;
			ll base = nCr(n - i, idx * k);
			base = (1LL * base * fac[idx * k]) % mod;
			base = (1LL * base * mpow(finv[idx], k)) % mod;
			base = (1LL * base * finv[k]) % mod;
			dp[sum][j + 1] = (dp[sum][j + 1] + (dp[i][j] * base) % mod) % mod;
		}
	}
	printf("%lld", dp[n][b - a + 1]);
	return 0;
}


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

int main()
{
    fast_io
    ll i,a,b,c,d,j,k;
    cin>>a>>b>>c;

    cout<<max(a+b,max(a*b,a-b));

    return 0;
}

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

int main(){
  int x,y,z;
  cin >> x >> y >> z;
  swap(x,y);
  swap(x,z);
  cout << x << " " << y << " " << z << endl;
}


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

vector<vector<int>> graph;
vector<int> parent;
vector<int> visited;
vector<pair<int,int>> depth;

void DFS(int v, int parent_v, int d){
    parent[v] = parent_v;
    depth[v] = {d, v};

    for(int child_v : graph[v]){
        DFS(child_v, v, d+1);
    }
}

int main(){
    int s = 0;// starting point
    int n, k;
    cin >> n >> k;

    graph.resize(n);
    parent.resize(n);
    visited.resize(n);
    depth.resize(n);

    int ans = 0;
    int a0;
    cin >> a0;
    if(a0 != 1) ans = 1;

    for(int i=1; i<n; i++){
        int a;
        cin >> a;
        a -= 1;

        graph[a].push_back(i);
    }

    DFS(0,-1,0);
    sort(depth.begin(),depth.end());
    reverse(depth.begin(),depth.end());

    for(int i=0; i<n; i++){
        if(depth[i].first <= k) break;

        int current = depth[i].second;
        for(int j=0; j<k; j++){
            if(visited[current] == true) break;
            visited[current] = true;
            current = parent[current];
            if(j == k-1) ans += 1;
        }
    }
    cout << ans << endl;
    return 0;
}

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

void solve(int n,int mn,int mx){
    int t,st=0,maxx=0,ans=0;
    vector<int> v;
    cin >> st;
    for(int i=0;i<n-1;i++){
        cin >> t;
        v.push_back(st-t);
        st=t;
    }
    for(int i=mn-1;i<mx;i++){
        if(maxx<v[i]){
            maxx=v[i];
        }
        if(maxx<=v[i]){
            ans=i+1;
        }
    }

    cout<<ans<<endl;

}

int main(void){
    int a,b,c;
    while(cin>>a>>b>>c,a){
        solve(a,b,c);
    }

}


/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <numeric>
#include <iterator>
#include <fstream>
#define SIZE 100005
#define MOD 1000000007

using namespace std;

class BK {
public:
    static void solve(std::istream& cin, std::ostream& cout) {
      int64_t k, t;
      cin >> k >> t;
      vector<int64_t> vec(t);
      for (int i = 0; i < t; ++i) {
        cin >> vec[i];
      }
      sort(vec.begin(), vec.end());
      int64_t max_vec = vec.back();
      vec.pop_back();
      int64_t sum = accumulate(vec.begin(), vec.end(), 0l);
      cout << max(max_vec - sum - 1, 0l) << endl;
    }
};

int main() {
    BK solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}

#include<iostream>

int main(){
    long long a,b;
    std::cin >> a >> b;
    long long ans = 1e18;
    if(std::abs(a) == std::abs(b)){
       std::cout << 1 << std::endl;
       return 0;
    }
    if(-a < b){
      ans = std::min(ans, a + b + 1);
    }
    if(a < -b){
       ans = std::min(-a - b + 1, ans);
    }
    if(-a < -b){
        ans = std::min(ans,a - b + 2);
    }
    if(a < b){
        ans = std::min(ans, b - a);
    }
    std::cout << ans << std::endl;
}


#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
int const MOD = 1000000007;
ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}
int madd(int a, int b) {return (a + b) % MOD;}
int msub(int a, int b) {return (a - b + MOD) % MOD;}
int mmul(int a, int b) {return (a * b) % MOD;}
int minv(int a) {return mod_pow(a, MOD-2);}
int mdiv(int a, int b) {return mmul(a, minv(b));}

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int board[15][15];
signed main() {
    int n;
    while(cin >> n, n) {
        memset(board, 0, sizeof(board));
        rep(i,0,n) rep(j,0,n) cin >> board[i][j];
        rep(i,0,n) rep(j,0,n) {
            board[i][n] += board[i][j];
            board[n][n] += board[i][j];
        }
        rep(j,0,n) rep(i,0,n) {
            board[n][j] += board[i][j];
        }
        repq(i,0,n) {
            repq(j,0,n) printf("%5lld", board[i][j]);
            cout << endl;
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
	string str;
	while (getline(cin, str)) {
		int cnt = 0;
		for (int i = 0; i < 26; ++i) {
			for (int j = 0; j < (int)str.size(); ++j) {
				if (str[j] >= 'a' && str[j] <= 'z') {
					str[j] = (str[j] - 'a' + 1) % 26 + 'a';
				}
			}
			cnt++;
			if (str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break;
		}
		for (int i = 0; i < 26; ++i) {
			for (int j = 0; j < (int)str.size(); ++j) {
				if (str[j] >= 'a' && str[j] <= 'z') {
					str[j] = (str[j] - 'a' + cnt) % 26 + 'a';
				}
			}
		}
		cout << str << endl;
	}
}


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

int main(){
    int N, K;
    cin >> N >> K;
    vector<float> p(N);
    for(int i=0; i<N; i++) cin >> p.at(i);
    for(int i=0; i<N; i++) p.at(i) = (p.at(i) + 1) / 2;
    vector<double> q(N);
    q.at(0) = p.at(0);
    for(int i=1; i<N; i++) q.at(i) = q.at(i-1) + p.at(i);
    vector<double> r(N - K + 1);
    r.at(0) = q.at(K-1);
    for(int i=1; i<N-K+1; i++){
        r.at(i) = q.at(i+K-1) - q.at(i-1);
    }
    double max = 0;
    for(int i=0; i<N-K+1; i++){
        if(max < r.at(i)) max = r.at(i);
    }
    cout << fixed << setprecision(12);
    cout << max << endl;
}

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
#define VL vector<lol>
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    cout << fixed << setprecision(7) ;
    double result{0};
    lol n; cin >> n;
    lol k; cin >> k;
    VL p(n);
    REP(i, n)
    {
        cin >> p[i];
    }
    FOR(i, 0, k-1)
    {
        double nume = (p[i]*(p[i]+1))/2;
        result += nume/p[i];
    }
    double MA = result;
    FOR(i, 1, n-k)
    {
        double nume1 = (p[i-1]*(p[i-1]+1))/2;
        MA -= nume1/p[i-1];
        double nume2 = (p[k+i-1]*(p[k+i-1]+1))/2;
        MA += nume2/p[k+i-1];
        //cout << MA << " ";
        result = max(result, MA);
    }
    //cout << endl;

    cout << result << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N, M;
    while (cin >> N >> M, N) {
        vector<int> p(N);
        int sum = 0;
        for (int i = 0; i < N; i++) {
            cin >> p[i];
            sum += p[i];
        }
        sort(p.begin(), p.end());
        for (int i = N - M; i >= 0; i -= M) {
            sum -= p[i];
        }
        cout << sum << endl;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <boost/tokenizer.hpp>
#include <boost/lexical_cast.hpp>
#include <vector>
#include <list>

using namespace std;
using namespace boost;

int main(int argc, char* argv[])
{
	using sprtr = char_separator<char>;
	using tknzr = tokenizer<sprtr>;
	sprtr sep(" ", "", keep_empty_tokens);

	int f, mf, mo;

	string line;
	while(1) {

		int n, m;
		{
			getline(cin, line);
			tknzr tkns(line, sep);
			auto it = tkns.begin();
			n = lexical_cast<int>(*it++);
			m = lexical_cast<int>(*it);
		}

		if( n == 0 && m == 0 ) {
			break;
		}

		list<int> ps;
		{
			getline(cin, line);
			tknzr tkns(line, sep);
			for( auto p : tkns ) {
				//cout << p << endl;
				ps.push_back(lexical_cast<int>(p));
			}
		}

		ps.sort(greater<int>());

		int div = n / m;
		int mod = n % m;

		int sum = 0;
		auto it = ps.begin();
		for( int i = 0; i < div; i++ ) {
			for( int j = 0; j < m; j++ ) {
				auto p = *it++;
				if( j == m-1 ) continue;
				sum += p;
			}
		}

		if( mod ) {
			for( int i = 0; i < mod; i++ ) {
				auto p = *it++;
				sum += p;
			}
		}

		cout << sum << endl;

		ps.clear();

	}

    return 0;
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <stack>
#include <list>
#include <math.h>
#include <map>
#include <iomanip>
#include <functional>
#include <string>
#include <algorithm>
#include <queue>
#include <set>

using namespace std;

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) os << *i << (i == end(v) - 1 ? "" : " "); return os;
}
template<class T> istream& operator>>(istream& is, vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) is >> *i; return is;
}

#define MOD 1000000007

struct Q {
	int b_id;
	int steps;
	int q_id;

	Q(int b_id, int q_id) : b_id(b_id), q_id(q_id), steps(0) {}

	bool operator<(const Q& other) const
	{
		return std::tie(b_id, q_id) < std::tie(other.b_id, other.q_id);
	}
};

int ofs[1000000];
int ans[1000000];
vector<set<Q>> qs;

void merge_into(int from, int to)
{
	if (qs[from].size() > qs[to].size())
	{
		swap(qs[from], qs[to]);
		swap(ofs[from], ofs[to]);
	}
	for (auto x : qs[from])
	{
		x.steps += ofs[from] - ofs[to];
		qs[to].insert(x);
	}
	qs[from].clear();
}

int main() {

#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

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

	int n;
	cin >> n;

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

	qs.resize(n);

	int L;
	cin >> L;

	int q;
	cin >> q;
	for (int i = 0; i < q; i++)
	{
		int a, b;
		cin >> a >> b;
		a--, b--;

		if (a > b)
			swap(a, b);
		qs[a].insert(Q(b, i));
	}

	for (int i = 0; i < n; i++)
	{
		while (qs[i].size() > 0 && qs[i].begin()->b_id <= i)
		{
			auto f = *qs[i].begin();
			qs[i].erase(qs[i].begin());
			ans[f.q_id] = f.steps + ofs[i];
		}
		ofs[i]++;
		int to = lower_bound(x.begin(), x.end(), x[i] + L + 1) - x.begin() - 1;
		merge_into(i, to);
	}

	for (int i = 0; i < q; i++)
		cout << ans[i] << "\n";

	return 0;
}

#include<bits/stdc++.h>

using namespace std;
using ll = long long;

/***********debug tools***********/
template<class T> inline ostream& operator<<(ostream& os,vector<T> arr) {os << "["; for(int i = 0; i < (int)arr.size(); i++)os << arr[i] << (i == (int)arr.size() - 1 ? "]" : ",");os << endl;return os;}
template<typename A, typename B> ostream& operator<<(ostream& os, const pair<A,B>& p){os << "{" << p.first << "," << p.second << "}";return os; }
#define prvec(v) cerr<<#v<<": [";for(int __i = 0;__i < (int)(v).size(); __i++)cerr<<((v)[__i])<<(__i+1==(int)(v).size()?"]\n":",");
#define print(x) cerr<<#x<<": "<<(x)<<endl
/*********************************/

const int D = 30;
const int MAX_N = 100000;

int n, l;
vector<int> x;
vector<vector<int>> tor, tol;

void ftor() {
    for(int i = 0; i < n; i++) {

        int L = i + 1, R = n; //ooooxxx
        while(R - L > 1) {
            int mid = (L + R) / 2;
            (x[mid] - x[i] <= l ? L : R) = mid;
        }
        tor[0][i] = L;
    }
    tor[0][n - 1] = n - 1;

    for(int i = 0; i < D - 1; i++) {
        for(int j = 0; j < n; j++) {
            tor[i + 1][j] = tor[i][tor[i][j]];
        }
    }

}

void ftol() {
    for(int i = 1; i < n; i++) {
        int L = -1, R = i - 1;//xxxxxoooo
        while(R - L > 1) {
            int mid = (L + R) / 2;
            (x[i] - x[mid] <= l ? R : L) = mid;
        }
        tol[0][i] = R;
    }
    tol[0][0] = 0;
    for(int i = 0; i < D - 1; i++) {
        for(int j = 0; j < n; j++) {
            tol[i + 1][j] = tol[i][tol[i][j]];
        }
    }

}

int main()
{
    cin >> n;
    x.resize(n), tor.resize(D, vector<int>(n));
    tol = tor;
    for(int i = 0; i < n; i++)cin >> x[i];
    cin >> l;
    ftor();
    ftol();

    int Q; cin >> Q;
    while(Q--) {
        int a, b;
        cin >> a >> b;
        a--,b--;
        if(a > b) {

            int l = 0, r = 2 * n;//xxxxxxoooo
            while(r - l > 1) {
                int mid = (l + r) / 2;
                int pos = a;
                for(int i = 0; i < D; i++) {
                    if(mid & (1<<i))pos = tol[i][pos];
                }
                (pos <= b ? r : l) = mid;
            }
            cout << r << endl;

        } else {
            int l = 0, r = 2 * n;//xxxxxxoooo
            while(r - l > 1) {
                int mid = (l + r) / 2;
                int pos = a;
                for(int i = 0; i < D; i++) {
                    if(mid & (1<<i))pos = tor[i][pos];
                }
                (pos >= b ? r : l) = mid;
            }
            cout << r << endl;
        }

    }

}


#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    cout << (s.substr(0,(s.length())-8))<<endl;
    return 0;
}

#include<iostream>

using namespace std;
int main() {
    int d;
    while(cin >> d) {
        long long ans = 0;
        int y = d;
        while (y <= 600 - d) {
            ans += (long long)y * y * d;
            y += d;
        }
        cout << ans << endl;
    }
}


#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int k,x;
    cin >> k >> x;
    for(int i=x-(k-1);i<=x+(k-1);i++)
        printf("%d ",i);

    return 0;
}

#include <iostream>
using namespace std;

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

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

    int _n = n - 1;
    for (int j = _n; 0 <= j; --j) {
        if (j == 0)
            cout << ary[j] << endl;
        else
            cout << ary[j] << " ";
    }

    delete[] ary;
    return 0;
}


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

int main()
{
	int n; char c; string s;
	while(cin >> n)
	{
		int cd[13]={0},pr[5]={0};

		cd[n-1]++;
		for(int i=0; i<4; i++)
		{
			cin >> c >> n;
			cd[n-1]++;
		}

		for(int i=0; i<13; i++)
		{
			pr[cd[i]]++;
		}

		bool st=false;
		for(int i=0; i<10; i++)
		{
			int sm=0;
			for(int j=0; j<5; j++) sm+=(cd[(i+j)%13]?1:0);
			if(sm==5) st=true;
		}

		                      s="null";
		     if(pr[4])        s="four card";
		else if(pr[3]&&pr[2]) s="full house";
		else if(st)           s="straight";
		else if(pr[3])        s="three card";
		else if(pr[2]==2)     s="two pair";
		else if(pr[2])        s="one pair";

		cout << s << endl;
	}
}

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

int main(){
	int n[5], num[14], pair[3],i;
	while (scanf("%d,%d,%d,%d,%d",&n[0],&n[1],&n[2],&n[3],&n[4]) != EOF){
		i = 0;
		for (int i = 0; i < 14; i++) num[i] = 0;
		for (int i = 0; i < 3; i++) pair[i] = 0;
		for (int i = 0; i < 5; i++) num[n[i] - 1]++;
		for (int i = 0; i < 13; i++){
			if (num[i] > 1) pair[num[i] - 2]++;
		}
		if (pair[2]) cout << "four card" << endl;
		else if (pair[0] && pair[1]) cout << "full house" << endl;
		else if (pair[1]) cout << "three card" << endl;
		else if (pair[0] == 2) cout << "two pair" << endl;
		else if (pair[0]) cout << "one pair" << endl;
		else{
			num[13] = num[0];
			for (i = 0; i < 10; i++){
				if (num[i] == 1 && num[i] == num[i + 1] && num[i + 1] == num[i + 2] && num[i + 2] == num[i + 3] && num[i + 3] == num[i + 4]) {
					cout << "straight" << endl;
					break;
				}
			}
		}
		if (i == 10)  cout << "null" << endl;
	}
	return 0;
}


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

using namespace std;
const int N=1e6+10;
int rd()
{
    int x=0,w=1;char ch=0;
    while(ch<'0'||ch>'9'){if(ch=='-') w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+(ch^48);ch=getchar();}
    return x*w;
}
int n,q[N<<1],hd,tl,tg;
char cc[N],ss[N];

int main()
{
    ///
    n=rd();
    scanf("%s%s",cc+1,ss+1);
    hd=n+1,tl=n;
    int ans=0;
    for(int i=n,j=n;i;--i)
    {
	while(j&&(i<j||cc[j]!=ss[i])) --j;
	if(!j){puts("-1");return 0;}
	if(i==j){hd=n+1,tl=n,tg=0;continue;}
	if(hd>tl) q[++tl]=j-tg,q[++tl]=i-tg,ans=max(ans,1);
	else
	{
	    --tg;
	    q[--hd]=j-tg;
	    while(hd<=tl&&q[tl]+tg>=i) --tl;
	    q[++tl]=i-tg;
	    ans=max(ans,tl-hd);
	}
	while(i>j&&ss[i-1]==ss[i]) --i;
    }
    printf("%d\n",ans);
    return 0;
}

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

int main() {
	int N;
	cin >> N;
	vector<int>A(N +1 );
	for (int n = 0;n<N;++n) {
		cin >> A[n + 1];
	}
	vector<int>B(N + 1);
	for (int n = N;n>=1;--n) {
		int sum = 0;
		for (int m = n + n;m <= N;m += n) {
			sum += B[m];
		}
		if (A[n] == sum%2) {
			B[n] = 0;
		}
		else{
			B[n] = 1;
		}
	}
	vector<int>Ans;
	for (int n = 0; n < N; ++n) {
		if (0 != B[n + 1]) {
			Ans.push_back(n + 1);
		}
	}
	cout << Ans.size()<<endl;
	for (int n = 0; n < Ans.size(); ++n) {
		if (0 !=n) {
			cout << " ";
		}
		cout << Ans[n];
	}
	return 0;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <sstream>
#include <string>
#include <utility>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>

using namespace std;

class APSPath
{
public:
  int solve();
};

int APSPath::solve()
{
  const int infty = 2147483647;

  int vn, en;
  cin >> vn >> en;

  vector<vector<int>> adj (vn, vector<int>(vn, infty));

  for ( auto i = 0; i < en; ++i )
    {
      int u, v;
      cin >> u >> v;
      cin >> adj[u][v];
    }

  for ( auto i = 0; i < vn; ++i )
    adj[i][i] = 0;

  for ( auto k = 0; k < vn; ++k )
    {
      for ( auto i = 0; i < vn; ++i )
        {
          for ( auto j = 0; j < vn; ++j )
            {
              if ( adj[i][j] > adj[i][k] + adj[k][j] && adj[i][k] != infty && adj[k][j] != infty )
                adj[i][j] = adj[i][k] + adj[k][j];
            }
        }
    }

  for ( auto i = 0; i < vn; ++i )
    if ( adj[i][i] < 0 )
      {
        cout << "NEGATIVE CYCLE" << endl;
        return 0;
      }

  for ( auto i = 0; i < vn; ++i )
    {
      for ( auto j = 0; j < vn; ++j )
        {
          if ( j ) cout << " ";
          if ( adj[i][j] == infty )
            cout << "INF";
          else
            cout << adj[i][j];
        }
      cout << endl;
    }

  return 0;
}

int main()
{
  APSPath apsp;

  apsp.solve();

  return 0;
}

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

using namespace std;

void dfs1(vector<vector<pair<int,int>>> &graph, vector<int> &num, vector<int> &used, int node, int &con){

        if(used[node]) return ;

        used[node] = true;

        for(pair<int,int> next : graph[node]){
                dfs1(graph, num, used, next.first, con);
        }

        num[con++] = node;
}

void dfs2(vector<vector<pair<int,int>>> &graph, vector<int> &scc, vector<int> &used, int node, int same){

        if(used[node]) return ;

        used[node] = true;

        for(pair<int,int> next : graph[node]){
                dfs2(graph, scc, used, next.first, same);
        }

        scc[node] = same;
}

void Strongly_Connected_Components(vector<vector<pair<int,int>>> &graph, vector<int> &scc){
        vector<int>  used(graph.size()), num(graph.size());
        vector<vector<pair<int,int>>> graph2(graph.size());
        int con = 0;

        scc.resize(graph.size());

        for(int i = 0; i < graph.size(); i++){
                dfs1(graph, num, used, i, con);
        }

        for(int i = 0; i < graph.size(); i++){
                for(int j = 0; j < graph[i].size(); j++){
                        graph2[graph[i][j].first].push_back(make_pair(i, graph[i][j].second));
                }
        }

        used.clear();
        used.resize(graph.size());

        for(int i = (int)graph.size()-1, same = 0; i >= 0; i--){
                if(!used[num[i]]){
                        dfs2(graph2, scc, used, num[i], same);
                        same++;
                }
        }

}

signed main(){
        int V, E;
        int Q;
        vector<int> scc;
        vector<vector<pair<int,int>>> graph;

        cin>>V>>E;

        graph.resize(V);

        for(int i = 0; i < E; i++){
                int s, t;

                cin>>s>>t;

                graph[s].push_back(make_pair(t,0));
        }

        Strongly_Connected_Components(graph, scc);

        cin>>Q;

        for(int i = 0; i < Q; i++){
                int u, v;

                cin>>u>>v;

                cout<<(scc[u] == scc[v])<<endl;
        }

        return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define pb push_back
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v) cerr << #v << ":"; rep(i, v.size()) cerr << " " << v[i]; cerr<<endl
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; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

template<typename T>
struct BinaryIndexedTree {
    /* 0-indexed */
    vector<T> data;

    BinaryIndexedTree(int sz) {
        data.assign(++sz, 0);
    }

    T sum(int k) {
        T ret = 0;
        for (++k; k > 0; k -= k & -k) ret += data[k];
        return (ret);
    }

    void add(int k, T x) {
        for (++k; k < data.size(); k += k & -k) data[k] += x;
    }
};

vector<pii> Q[505050];

void solve() {
    int n, q;
    cin >> n >> q;
    vector<int> C(n);
    rep(i, n) {
        cin >> C[i];
        C[i]--;
    }
    vector<int> ans(q);
    rep(i, q) {
        int l, r;
        cin >> l >> r;
        l--; r--;
        Q[r].pb({l, i});
    }
    BinaryIndexedTree<int> BIT(n);
    vector<int> R(n + 1, -1);
    rep(i, n) {
        if (R[C[i]] != -1) BIT.add(R[C[i]], -1);
        BIT.add(i, 1);
        R[C[i]] = i;
        for(auto query : Q[i]) {
            int l = query.fi, r = i;
            int idx = query.se;
            ans[idx] = BIT.sum(r) - BIT.sum(l - 1);
        }
    }
    rep(i, q) {
        cout << ans[i] << endl;
    }
}

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

#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++)
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
char buf[1<<23],*p1=buf,*p2=buf;
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
const int yuzu=5e5;
typedef int fuko[yuzu|10];
struct node {
  int l,r,id;
  void rd(int x) {
    read(l),read(r),id=x;
  }
}qr[yuzu|10];
fuko c,cnt,lxy;
int main() {
  int i,n,q,bk;
  read(n),read(q),bk=sqrt(n);
  for (i=1;i<=n;++i) c[i]=read();
  for (i=1;i<=q;++i) qr[i].rd(i);
  sort(qr+1,qr+q+1,[&](node a,node b){return a.l/bk^b.l/bk?a.l<b.l:a.r<b.r;});
  int nl=1,nr=0,ans=0;
  for (i=1;i<=q;++i) {
    for (;nr<qr[i].r;) !cnt[c[++nr]]++?++ans:0;
    for (;nr>qr[i].r;) !--cnt[c[nr--]]?--ans:0;
    for (;nl<qr[i].l;) !--cnt[c[nl++]]?--ans:0;
    for (;nl>qr[i].l;) !cnt[c[--nl]]++?++ans:0;
    lxy[qr[i].id]=ans;
  }
  for (i=1;i<=q;++i) printf("%d\n",lxy[i]);
}


#include<iostream>

using namespace std;

int main(){
	int n;
	while(cin>>n && n){
		int a=0,b=0;

		for(int i=0;i<n;i++){
			int x,y;
			cin>>x>>y;
			if(x>y)a+=x+y;
			else if(x==y){
				a+=x;b+=y;
			}
			else b+=x+y;
		}
		cout<<a<<" "<<b<<endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
long long solve(){
  	int n;
	cin>>n;
  	long long A[n][n];
	long long dp[(1<<n)];
	for(int i=0;i<n;i++) for(int j=0;j<n;j++) cin>>A[i][j];
	dp[0]=0;
	for(int i=1;i<1<<n;i++){
		dp[i]=0;
		for(int j=0;j<n;j++){
			if(i&(1<<j)){
				for(int k=j+1;k<n;k++){
					if(i&(1<<k)) dp[i]+=A[j][k];
				}
			}
		}
	}
	for(int mask=1;mask<1<<n;mask++){
		for(int ss=mask;ss>0;ss=(ss-1)&mask){
			dp[mask]=max(dp[mask],dp[ss]+dp[mask^ss]);
		}
	}
	return dp[(1<<n)-1];
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout<<solve()<<"\n";
}

#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <deque>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb emplace_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
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;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vector<vec> v){for(auto e:v){for(auto ee:e)cout<<ee<<" ";cout<<endl;}}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}
const int INF=1e6;
const int MAX_ROW = 510; // to be set appropriately
const int MAX_COL = 510; // to be set appropriately
struct UnionFind{
    vector<int> par,sizes;
    UnionFind(int n):par(n+1),sizes(n+1,1){
        rep2(i,1,n)par[i]=i;
    }
    int find(int x){
        return (x==par[x]?x:par[x]=find(par[x]));
    }
    void unite(int x,int y){
        x=find(x);y=find(y);
        if(x==y)return ;
        if(sizes[x]<sizes[y]){
            swap(x,y);
        }
        par[y]=x;
        sizes[x]+=sizes[y];
    }
    bool same(int x,int y) {return (find(x)==find(y));}
    int size(int x) {return sizes[find(x)];}
};
ll ans,d;
void solve(int n,vector<ll> v,vector<ll> w){
    vector<pair<ll,int>> x,y;
    rep(i,n){
        x.pb(v[i],i);
        y.pb(w[i],i);
    }
    sort(all(x));sort(all(y));
    vec b(n),c(n);
    vecll B(n),C(n);
    int now=0;
    rep(i,n){
        while(now<x[i].second){
            b[now]=x[i].second;
            B[now]=x[i].first+w[now];
            now++;
        }
    }
    B[n-1]=LONG_MAX;
    C[0]=LONG_MAX;
    now=n-1;
    rep(i,n){
        while(now>y[i].second){
            c[now]=y[i].second;
            C[now]=y[i].first+v[now];
            now--;
        }
    }
    UnionFind uf(n);
    // print(b);print(B);
    // print(c);print(C);
    rep(i,n){
        if(B[i]<C[i]){
            if(!uf.same(i,b[i])){
                ans+=B[i];
                uf.unite(i,b[i]);
            }
        }
        else{
            if(!uf.same(i,c[i])){
                ans+=C[i];
                uf.unite(i,c[i]);
            }
        }
    }
    map<int,vec> mp;
    rep(i,n){
        mp[uf.find(i)].pb(i);
    }
    if(mp.size()==1)return ;
    else{
        int nn=mp.size();
        vecll vvc,ww;
        for(auto vv:mp){
            ll t=LONG_MAX,s=LONG_MAX;
            for(auto e:vv.second){
                chmin(t,v[e]);
                chmin(s,w[e]);
            }
            vvc.push_back(t);
            ww.pb(s);
        }
        solve(nn,vvc,ww);
    }
}
main(){
    int n=in();d=in();
    vector<ll> v,w;
    vecll a;
    rep(i,n)a.pb(in());
    rep(i,n){
        v.pb(a[i]+d*i);
        w.pb(a[i]-d*i);
    }
    solve(n,v,w);
    cout<<ans;
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N;
    vector<ll> L;
    ll count = 0;
    cin >> N;
    L.resize(2 * N);
    rep(i, 2 * N) cin >> L[i];
    sort(L.begin(), L.end());
    rep(i, N) count += L[2 * i];
    cout << count << endl;
    return 0;
}

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

int main() {
	int size;
	cin>>size;
	int arr[2*size]={};
	int ans=0;

	for(int i=0;i<2*size;i++){
	    cin>>arr[i];

	}

	sort(arr,arr+2*size);
	for(int i=0;i<2*size;i++){
	    if(i%2==0){
	        ans=ans+arr[i];
	    }
	}
	cout<<ans;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;

typedef long long LL;

const int MAXN=400;

LL n, m, ans, cntW, cntB;
bool visited[MAXN][MAXN];
string s[MAXN];

bool avail(int i, int j, char c){
	if(i < 0 || i >= n || j < 0 || j >= m) return false;
	if(s[i][j] == c) return false;
	return true;
}

void dfs(int i, int j){
	if(i < 0 || i >= n || j < 0 || j >= m) return;
	if(visited[i][j]) return;

	visited[i][j] = true;
	if(s[i][j] == '.') cntW++;
	else cntB++;
	if(avail(i, j - 1, s[i][j])) dfs(i, j - 1);
	if(avail(i, j + 1, s[i][j])) dfs(i, j + 1);
	if(avail(i + 1, j, s[i][j])) dfs(i + 1, j);
	if(avail(i - 1, j, s[i][j])) dfs(i - 1, j);
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; i++) cin >> s[i];

	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++)
			visited[i][j] = false;

	ans = 0;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++)
			if(!visited[i][j]){
				cntB = 0; cntW = 0;

				dfs(i, j);
				ans += cntB * cntW;
			}
	cout << ans << "\n";
}


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

int main() {
  int n;
  cin >> n;
  vector<string> s(0);
  vector<int> p(0);
  rep(i, n) {
    string si;
    cin >> si;
    bool hit = false;
    rep(j, s.size()) {
      if (s.at(j) == si) {
        p.at(j)++;
        hit = true;
        break;
      }
    }
    if (!hit) {
      s.push_back(si);
      p.push_back(1);
    }
  }
  cin >> n;
  rep(i, n) {
    string si;
    cin >> si;
    rep(j, s.size()) {
      if (s.at(j) == si) {
        p.at(j)--;
        break;
      }
    }
  }
  int max = 0;
  rep(j, s.size()) if (p.at(j) > max) max = p.at(j);
  cout << max << endl;
}

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

template <class t>
using vc = vector<t>;
template <class t>
using vvc = vector<vector<t>>;
typedef long long ll;
typedef vc<int> vi;
typedef vvc<int> vvi;
typedef pair<int, int> pi;

#define uset unordered_set
#define umap unordered_map

#define endl "\n"

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()

#define all(a) a.bg, a.ed

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

template <class t>
ostream &operator<<(ostream &os, const vc<t> &v) {
    os << "[ ";
    for (int i = 0; i < v.size(); i++) {
        os << v[i];
        if (i != v.size() - 1) {
            os << ", ";
        }
    }
    return os << " ]";
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    // cout << fixed << setprecision(18);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // Solution

    long long n, m;
    cin >> n;
    umap<string, long long> points;
    string temp;
    for (int i = 1; i <= n; i++) {
        cin >> temp;
        points[temp]++;
    }
    cin >> m;
    for (int i = 1; i <= m; i++) {
        cin >> temp;
        points[temp]--;
    }
    long long best_point = 0;
    for (auto &p : points) {
        best_point = max(best_point, p.second);
    }
    cout << best_point;
}


#include <cstdio>
#include <algorithm>

using i8 = std::int8_t;
using u8 = std::uint8_t;
using i16 = std::int16_t;
using u16 = std::uint16_t;
using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
using usize = std::size_t;

i32 a[200000];

auto main() -> i32 {
	i32 n, k;
	scanf("%d%d", &n, &k);
	for (i32 i = 0; i < n; i += 1) {
		scanf("%d", a + i);
	}
	i32 b[200001];
	for (i32 step = 0; step < std::min(64, k); step += 1) {
		std::fill(b, b + n + 1, 0);
		for (i32 i = 0; i < n; i += 1) {
			b[std::max(0, i - a[i])] += 1;
			b[std::min(n, i + a[i] + 1)] -= 1;
		}
		a[0] = b[0];
		for (i32 i = 1; i < n; i += 1) {
			b[i] += b[i - 1];
			a[i] = b[i];
		}
	}
	for (i32 i = 0; i < n; i += 1) {
		printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');
	}
	return 0;
}

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

int n, k;
bool alln(vector<int>& v){
  for(int i=0;i<n;++i) if(v[i]!=n) return false;
  return true;
}

void simulate(vector<int>& v){
  int cnt = 0;
  vector<int> tmp(n+1, 0);
  for(int i=0;i<n;++i) {
    tmp[max(0, i-v[i])]++;
    tmp[min(n, i+v[i]+1)]--;
  }
  for(int i=0;i<n;++i){
    cnt += tmp[i];
    v[i] = cnt;
  }
}

int main() {
  scanf("%d %d", &n, &k);
  vector<int> v(n);
  for(int i=0;i<n;++i) scanf("%d", &v[i]);

  while(k--){
    simulate(v);
    if(alln(v)){
      for(int i=0;i<n;++i) cout << n << (i==n-1?'\n':' ');
      return 0;
    }
  }
  for(int i=0;i<n;++i) cout << v[i] << (i==n-1?'\n':' ');
  return 0;
}


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

long long mod = 1e9+7;

int main(){
  int N;
  cin >> N;
  vector<long long> A(N);
  for(int i = 0; i < N; i++)
    cin >> A[i];
  long long ans = 0;
  long long sum = 0;
  long long sum2 = 0;

  for(int i = 0; i < N; i++){
    sum2 = (sum2 + A[i]*A[i]) % (2*mod);
    sum = (sum + A[i]) % (2*mod);
  }

  ans = (sum*sum - sum2)  % (2*mod) / 2;

  cout << ans << endl;
}

#include <iostream>
#include <algorithm>
#include <cmath>

const int lens = 2e5 + 1;
const long long mod = 1e9 + 7;

long long a[lens],sum[lens];
int main()
{
    int n;
    std::ios::sync_with_stdio(false);
    std::cin >> n;
    for(int i = 1;i <= n;i++)
    {
        std::cin >> a[i];
        sum[i] = sum[i - 1] + a[i];
    }

    long long ans = 0;
    for(int i = 1;i <= n;i++)
    {
        ans = (ans + (((sum[n] - sum[i]) % mod) * (a[i] % mod)) % mod) % mod;
    }
    std::cout << ans;
    return 0;
}


#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    int n = 0;
    int q = 0;
    cin >> n;

    int s[n];
    for (int i = 0; i < n; i++) {
        scanf("%d",&s[i]);
    }
    cin >> q;
    int t[q];
    for (int i = 0; i < q; i++) {
        scanf("%d",&t[i]);
    }
    int sum = 0;
    for (int i = 0; i < q; i++) {
        for (int j = 0; j < n; j++) {
            if (s[j] == t[i]) {
                sum++;
                break;
            }
        }
    }
    printf("%d\n",sum);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}

//Write From this Line

//const ll mod = 1e9+7;
//const ll mod = 998244353;
int main()
{
	int n;
	cin >> n;

	multiset<int> s;
	rep(i,n){
		int x;
		cin >> x;
		auto itr = s.lower_bound(x);
		if(itr == s.begin()){
			s.insert(x);
			continue;
		}
		itr--;
		s.erase(itr);
		s.insert(x);
	}
	cout << s.size() << endl;
}


//g++  7.4.0

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

int main()
{
    int k;
    cin >> k;
    std::string s;
    cin >> s;

    if(s.length() <= k){
        cout << s << endl;
    }else{
        cout << s.substr(0, k) << "..." << endl;
    }
}

#pragma GCC optimize("O3")

#include<bits/stdc++.h>
#define sp " "
#define endl "\n"
#define MAX 10e9
#define MAXN 100001
#define mod 1000000007
#define inf_int 2e9
#define inf_ll 2e18
#define e 1e-9
#define vi vector<int>
#define vl vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpl vector<pair<ll,ll>>
#define vpc vector<pair<char,char>>
#define adj_list vector<vl>
#define umap unordered_map<ll, ll>
#define pll pair<ll,pair<ll, ll>>
#define clr(x) memset(x,0,sizeof(x))
#define cy cout << "YES" << endl
#define cn cout << "NO" << endl
#define google cout << "Case #" << ++it << ": " << ans << endl;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
typedef long long int ll;

ll it = 0, ans = 0;

ll spf[MAXN];
void sieve()
{
    spf[1] = 1;
    for (auto i=2; i<MAXN; i++)
  		spf[i] = i;
  	for (auto i=4; i<MAXN; i+=2)
        spf[i] = 2;
    for (auto i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {
            for (auto j=i*i; j<MAXN; j+=i)
                if (spf[j]==j)
                    spf[j] = i;
        }
    }
	return;
}

vl getFactorization(ll x)
{
    vl ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}

void check()
{
	ll k;
	string s;
	cin >> k >> s;
	if(s.size()<=k) cout << s;
	else {
		// cout << k << endl;
		for(int i=0;i<k;i++) cout << s[i];
		cout << "...";
	}
    return ;
}

int32_t main()
{
    fastio
    ll t = 1;
    // cin >> t;
    while(t--)
        check();
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include<fstream>
#include<iostream>
#include<string>
#include<iomanip>
#include<list>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

short cost[110][110];
short time_data[110][110];

int main(){
	short n, m;

	while (cin >> n >> m && (n != 0 && m != 0)) {
		short min_ = 20000; // 答えの最小値
		short min_num = 1; // 答えの町

		short from, to, time_, cost_;
		short k;
		short k_from, k_to, info;

		for (short i = 1; i < 110; i++) {
			for (short j = 1; j < 110; j++) {
				if (i == j) {
					cost[i][j] = 0;
					time_data[i][j] = 0;
				} else {
					cost[i][j] = 20000;
					time_data[i][j] = 20000;
				}
			}
		}
		for (short i = 0; i < n; i++) {
			cin >> from >> to >> cost_ >> time_;
			cost[from][to] = cost_;
			cost[to][from] = cost_;
			time_data[from][to] = time_;
			time_data[to][from] = time_;
		}
		for (short k = 1; k <= m; k++) {
			for (short i = 1; i <= m; i++) {
				for (short j = 1; j <= m; j++) {
					cost[i][j] = min((int)cost[i][j], cost[i][k] + cost[k][j]);

					time_data[i][j] = min((int)time_data[i][j], time_data[i][k] + time_data[k][j]);
				}
			}
		}
		// 答えを求める
		cin >> k;
		for (short i = 0; i < k; i++) {
			cin >> k_from >> k_to >> info;
			if (info == 0) {
				cout << cost[k_from][k_to] << endl;
			} else {
				cout << time_data[k_from][k_to] << endl;
			}
		}

  }
	return 0;
}

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

long long member[4000];
bool ached[4000];
vector<int> ach;

int main(void){
  int n;
  while(true){
    cin >> n;
    if(n == 0)  break;
    fill(member, member + 4000, 0);
    fill(ached, ached + 4000, false);
    ach.clear();
    for(int i = 0; i < n; i++){
      long long id, tanka, suryo;
      cin >> id >> tanka >> suryo;
      member[id] += tanka * suryo;
      if(member[id] >= 1000000 && ached[id] == false){
        ach.push_back(id);
        ached[id] = true;
      }
    }

    if(ach.empty()){
      cout << "NA" << endl;
    }else{
      for(int i = 0; i < ach.size(); i++){
        cout << ach[i] << endl;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <set>

using namespace std;

#define rep(i,a,b) for(int i=(a); i<(b); i++)

int main(){
  int m,n;
  while(cin >> n >> m, m + n){
    int p[10001][2];
    set<int> fri1;
    set<int> fri2;
    rep(i,0,m){
      int a,b; cin >> a >> b;
      p[i][0] = a;
      p[i][1] = b;
      if(a == 1 || b == 1){
        fri1.insert(a);
        fri1.insert(b);
      }
    }
    if(fri1.size() == 0){
      cout << 0 << endl;
      continue;
    }
    rep(i,0,m){
      if(fri1.find(p[i][0]) != fri1.end() || fri1.find(p[i][1]) != fri1.end()){
        fri2.insert(p[i][0]);
        fri2.insert(p[i][1]);
      }
    }
    cout << fri2.size()-1 << endl;
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,a,b,x=0,count=0;
  while(1){
    cin >> n;
    if(n == 0) break;
    cin >> m;
    int data[n][n];
    int str[501]={0};
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	data[i][j]=0;
      }
    }
    for(int i=0;i<m;i++){
      cin >> a >> b;
      data[a-1][b-1]++;
      data[b-1][a-1]++;
      if( a == 1 ){
	str[x]=b-1;
	x++;
      } else if( b == 1){
	str[x]=a-1;
	x++;
      }
    }
    for(int i=0;i<x;i++){
      for(int j=1;j<n;j++){
	if(data[str[i]][j] != 0 && data[0][j] == 0){
	  data[0][j]++;
	}
      }
    }
    for(int i=1;i<n;i++){
      if( data[0][i] != 0){
      	count++;
      }
    }
    cout << count << endl;
    count=0;
    x=0;
  }
  return 0;
}


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

int main() {
    int n,m,q;cin>>n>>m>>q;
    int a[n+1][n+1]{};
    for (int i=0;i<m;i++) {
        int b,c;cin>>b>>c;
        a[b][c]++;
    }
    for (int i=1;i<=n;i++)
        for (int j=1;j<=n;j++)
            a[i][j]+=a[i][j-1];
    for (int i=1;i<=n;i++)
        for (int j=1;j<=n;j++)
            a[i][j]+=a[i-1][j];
    for (int i=0;i<q;i++) {
        int b,c;cin>>b>>c;
        cout<<a[c][c]-a[c][b-1]-a[b-1][c]+a[b-1][b-1]<<endl;
    }
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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

int main(){
    int n,m,q;cin>>n>>m>>q;
    vvi g(n);
    rep(i,m){
        int l,r;
        cin>>l>>r;
        l--;r--;
        g[l].PB(r);
    }
    rep(i,n){
        sort(all(g[i]));
    }
    rep(i,q){
        int P,Q;
        cin>>P>>Q;
        P--;Q--;
        int cnt=0;
        for(int j=P;j<=Q;++j){
            cnt+=upper_bound(all(g[j]),Q)-g[j].begin();
        }
        cout<<cnt<<endl;
    }
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;
using ll = long long;

unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

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

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    cout << max((a - b + 1),0) * max((a - c + 1),0) << endl;
}

#include <bits/stdc++.h>
const int MOD = 1e9 + 7, N = 40, L = 17;
int n, x, y, z, f[ N + 1 ][ 1 << L ];
int main( )
{
 std::ios::sync_with_stdio( false );
 std::cin >> n >> x >> y >> z;
 int mx = ( 1 << ( x + y + z ) ) - 1, ans = 1, haiku = ( ( 1 << ( x + y + z ) ) >> 1 ) | ( ( 1 << ( y + z ) ) >> 1 ) | ( ( 1 << z ) >> 1 );
 f[ 0 ][ 0 ] = 1;
 for( int i = 0; i < n; ++i, ans = ans * 10LL % MOD ) for( int s = 0; s <= mx; ++s )
 {
  if( !f[ i ][ s ] )
   continue;
  for( int j = 1; j <= 10; ++j )
  {
   int trs = ( s << j | ( 1 << j >> 1 ) ) & mx;
   if( ( trs & haiku ) ^ haiku )
    f[ i + 1 ][ trs ] = ( f[ i + 1 ][ trs ] + f[ i ][ s ] ) % MOD;
   }
 }
 int sub = 0;
 for( int i = 0; i <= mx; ++i )
  sub = ( sub + f[ n ][ i ] ) % MOD;
 std::cout << ( ans - sub + MOD ) % MOD;
 return 0;
}


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

int main() {
  int n,m;cin>>n>>m;
  vector<pair<int,int>> pr(m);
  rep(i,m){
    int s,c;cin>>s>>c;
    s--;
    pr[i]=make_pair(s,c);
  }
  rep(i,1000){
    bool ans=true;
    string a=to_string(i);
    int keta=a.size();
    if(n!=keta)continue;
    rep(j,m){
      if(a[pr[j].first]!=(char)('0'+pr[j].second))ans=false;
    }
    if(ans){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}

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

int main() {
	array<array<int,10>,2> ar;
	for(int i = 0; 2 > i; i++){
		for(int j = 0; 10 > j; j++){
			scanf("%d\n", &ar[i][j]);
		}
		sort(ar[i].begin(), ar[i].end(), [](int a, int b){return a > b;});
	}
	printf("%d %d\n", accumulate(ar[0].begin(), ar[0].begin()+3, 0), accumulate(ar[1].begin(), ar[1].begin()+3, 0));
	return 0;
}


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

signed main(){
  int N;
  cin>>N;
  int ans=1;
  while(ans*ans<=N)ans+=1;
  ans-=1;
  cout<<ans*ans<<endl;
  return 0;
}

#include <iostream>

int main(){
    int n;

    std::cin >> n;
    std::cout << n * n * n << std::endl;

    return 0;
}


#include <stdio.h>
#include <string.h>

int main() {
    int a, b, c = 0;
    char pscode[50];
    scanf("%d %d", &a, &b);
    scanf("%s", &pscode);
    for (int i = 0; i < strlen(pscode); i++) {
        if (pscode[a] != '-') {
            printf("No");
            return 0;
        }
        if (pscode[i] >= '0' && pscode[i] <= '9') {
            c++;
        }
    }
    if (c != (a+b)) {
        printf("No");
        return 0;
    }
    printf("Yes");
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;

int main()
{
    int n,h,w;
    cin >> n >> h >> w;
    cout << (n-h+1)*(n-w+1);
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<stack>
#define gc getchar()
#define N 103
#define sint short
#define upd(x,y) (x=max(x,(short)(y)))
#define debug(x) cerr<<#x<<"="<<x
#define sp <<" "
#define ln <<endl
using namespace std;
inline int inn()
{
	int x,ch;while((ch=gc)<'0'||ch>'9');
	x=ch^'0';while((ch=gc)>='0'&&ch<='9')
		x=(x<<1)+(x<<3)+(ch^'0');return x;
}
sint s[N][N],dp[N][N][N][N];char str[N][N];
inline sint S(int a,int b,int c,int d)
{
	if(a>c) swap(a,c);if(b>d) swap(b,d);
	return (short)(s[c][d]+s[a-1][b-1]-s[a-1][d]-s[c][b-1]);
}
int main()
{
	int n=inn(),m=inn(),x=0,y=0;sint ans=0;
	for(int i=1;i<=n;i++) scanf("%s",str[i]+1);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			if(str[i][j]=='E') x=i,y=j;
			else s[i][j]=(str[i][j]=='o');
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++)
		s[i][j]=(short)(s[i][j]+s[i-1][j]+s[i][j-1]-s[i-1][j-1]);
	for(int a=x;a;a--) for(int b=y;b;b--)
		for(int c=x;c<=n;c++) for(int d=y;d<=m;d++)
		{
			ans=max(ans,dp[a][b][c][d]);int L=d-y+1,R=m-y+b,U=c-x+1,D=n-x+a;
			if(a>U) upd(dp[a-1][b][c][d],dp[a][b][c][d]+S(a-1,max(b,L),a-1,min(d,R)));
			if(b>L) upd(dp[a][b-1][c][d],dp[a][b][c][d]+S(max(a,U),b-1,min(c,D),b-1));
			if(c<D) upd(dp[a][b][c+1][d],dp[a][b][c][d]+S(c+1,max(b,L),c+1,min(d,R)));
			if(d<R) upd(dp[a][b][c][d+1],dp[a][b][c][d]+S(max(a,U),d+1,min(c,D),d+1));
		}
	return !printf("%d\n",(int)ans);
}

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

int n, k;
ll ans = 10000000000, len;
int main()
{
    cin >> n >> k;
    vector<ll> x(n);
    rep(i, 0, n)
    {
        cin >> x[i];
    }

    ll l, r, lr, rl;
    for (int i = 0; i <= (n - k); i++)
    {
        l = i;
        r = l + k - 1;
        rl = abs(x[r]) + abs(x[r] - x[l]);
        lr = abs(x[l]) + abs(x[r] - x[l]);
        len = min(lr, rl);
        // cout << ans << "," << len << endl;
        ans = min(ans, len);
    }

    cout << ans << endl;
    return 0;
}


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

#define LL long long
#define DD long double

#define M 1000000007
#define INF 1e18

void setIO(string s = "") {
  cin.sync_with_stdio(0); cin.tie(0);
  if (s.size()) s += ".in", freopen(s.c_str(), "r", stdin);
}

int tt = 1;
void solve() {
  set<int> nums;
  int a;
  while (cin >> a) nums.insert(a);
  cout << ((nums.size() == 2) ? "Yes" : "No") << endl;
}

int main() {
  setIO();
  while (tt--) {
    solve();
  }
  return 0;
}

#include"bits/stdc++.h"
#include<iostream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define rep(i, c) for(int i = 0; i < (int)c; i++)
const ll inf = 1000000007;

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


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

int main() {
  int N,Q;
  cin >> N >> Q;
  vector<int> S(N),T(N),X(N);
  vector<int> D(Q);
  rep(i,N) cin >> S.at(i) >> T.at(i) >> X.at(i);
  rep(i,Q) cin >> D.at(i);

  set<P> s;
  vector<tuple<int,int,int>> a(N);
  vector<int> ans(Q,-1);

  rep(i,Q) s.insert(P(D.at(i),i));
  rep(i,N) a.at(i) = tie(X.at(i),S.at(i),T.at(i));
  sort(a.begin(),a.end());//位置でソート

  rep(i,N){//工事止めに対して
    int x,l,r;tie(x,l,r)=a.at(i);
    auto it=s.lower_bound(P(l-x,-1));
    while(it!=s.end()){
      if(it->first + x >= r) break;
      else{
        ans.at(it->second)=x;
        s.erase(it++);
      }
    }
    /*auto it=s.lower_bound(P(l,-1));//l以降のものを探す
    while(it!=s.end()){
      if(it->first>=r) break;//工事の影響がない
      ans.at(it->second)=x;//工事の影響でストップ
      s.erase(it++);//要素を消し，itをインクリメント
    }*/
  }
  rep(i,Q) cout << ans.at(i) << endl;
  return 0;
}

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<deque>
using namespace std;
const int maxn = 1000000 + 10;

int n, ans = 0;
char a[maxn], b[maxn];
deque <int> q;

int main() {
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  q.push_back(n + 1);
  for(int i = n, j = n + 1, del = 0;i >= 1;i --) {
    int tmp = j;
    while(j && (j > i || a[j] != b[i])) j --;
    if(!j) {
      puts("-1");
      return 0;
    }
    if(tmp == j) {
      while(!q.empty() && q.back() - del >= i) q.pop_back();
      q.push_back(i + del);
    }
    else {
      del ++;
      if(i != j) {
        ans = max(ans,(int)q.size());
        q.push_front(j + del);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

int main(){

	int n, ans, out;

	string str;

	bool base[3];

	cin >> n;

	for(int loop = 0; loop < n; loop++){

		base[0] = false;
		base[1] = false;
		base[2] = false;

		ans = 0;
		out = 0;

		while(true){

			cin >> str;

			if(str == "HIT"){
				if(base[2]){
					ans++;
				}
				if(base[1]){
					base[2] = true;
				}else{
					base[2] = false;
				}
				if(base[0]){
					base[1] = true;
				}else{
					base[1] = false;
				}
				base[0] = true;
			}else if(str == "HOMERUN"){
				ans++;
				if(base[2]){
					ans++;
				}
				if(base[1]){
					ans++;
				}
				if(base[0]){
					ans++;
				}
				base[0] = false;
				base[1] = false;
				base[2] = false;
			}else if(str == "OUT"){
				out++;
			}
			if(out >= 3){
				break;
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}

#include <iostream>
using namespace std;

int type(string s){
	if(s == "HIT")return 0;
	if(s == "OUT")return 1;
	if(s == "HOMERUN")return 2;
}
int main(){
	int n;
	string s;
	cin >> n;

	while(n--){
		int outCount = 0;
		int base = 0;
		int result = 0;
		while(outCount < 3){
			cin >> s;
			switch(type(s)){
			case 0:
				base <<= 1;
				base++;
				break;
			case 1:
				outCount++;
				break;
			case 2:
				result += __builtin_popcount(base)+1;
				base = 0;
				break;
			}
			if(base & 8)result++;
			base &= 7; // 0b0111
		}
		cout << result << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

#define TEMP_T template<typename T>
TEMP_T void sort(T& v){ sort(v.begin(), v.end()); }
TEMP_T void revs(T& v){ reverse(v.begin(), v.end()); }
TEMP_T void uniq(T& v){ sort(v); v.erase(unique(v.begin(), v.end())); }
TEMP_T void show(T& v, char delim=' ', char end='\n'){ for(int i=0; i<v.size()-1; i++) cout << v[i] << delim; cout << v[v.size()-1] << end; }
TEMP_T T    cums(T& v){ T r; r.push_back(v[0]); for(int i=1; i<v.size(); i++) r.push_back(r[i-1] + v[i]); return r; }
TEMP_T void maxe(T& v, T m){ v = max(v, m); }
TEMP_T void mine(T& v, T m){ v = min(v, m); }

static inline int in(){ int x; scanf("%d", &x); return x; }

int main()
{
  int n, m;
  while (n = in(), m = in()){
    vector<int> p;
    for (int i = 0; i < n; i++){
      p.push_back(in());
    }
    p.push_back(0);
    n++;

    vector<int> pp;
    for (int i = 0; i < n; i++){
      for (int j = 0; j < n; j++){
        pp.push_back(p[i] + p[j]);
      }
    }
    int maxi = 0;
    sort(pp);
    for (int i = 0; i < n; i++){
      for (int j = 0; j < n; j++){
        int s = p[i] + p[j];
        int v = *(upper_bound(pp.begin(), pp.end(), m - s) - 1);
        if (s + v <= m){
          maxe(maxi, s + v);
        }
      }
    }
    printf("%d\n", maxi);
  }

  return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <array>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;

vector<long> vec;
bool prime(int x)
{
	for(int i = 2; i <= sqrt(x); i++)
	{
		if(x%i == 0)
			return 0;
	}
	return 1;
}
long MAXN = 500;
long A[503][503];
long gcd(long a, long b) {return (b)? gcd(b,a%b) : a;}
long lcm(long a, long b)
{
	if(a == b && b == 0) return 0;
	else if(a == 0) return b;
	else if(b == 0) return a;
	else return a/gcd(a,b)*b;
}

int main()
{
	// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	for(int i = 2; i <= 10000; i++)
		if(prime(i))
			vec.push_back(i);

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

	int idx = 0;
	for(int i = 1; i <= MAXN; i+=2)
	{
		int x = 1, y = i;
		while(y <= MAXN)
			A[x++][y++] = vec[idx];
		idx++;
	}
	for(int i = 3; i <= MAXN; i+=2)
	{
		int x = i, y = 1;
		while(x <= MAXN)
			A[x++][y++] = vec[idx];
		idx++;
	}
	for(int i = 1; i <= MAXN; i+=2)
	{
		int x = 1, y = i;
		while(y >= 1 && x <= MAXN)
			A[x++][y--] *= vec[idx];
		idx++;
	}
	for(int i = MAXN; i >= 2; i-=2)
	{
		int x = i, y = MAXN;
		while(y >= 1 && x <= MAXN)
			A[x++][y--] *= vec[idx];
		idx++;
	}

	long mx = 0;

	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j <= n; j++)
		{
			if(A[i][j] == 0) A[i][j] = lcm(lcm(A[i-1][j],A[i][j-1]),lcm(A[i+1][j],A[i][j+1]))+1;
			// mxnax(A[i][j],mx);
			printf("%lld", A[i][j]);
			if(j < n) printf(" ");
		}
		printf("\n");
	}
	// printf("%lld\n", mx);
}


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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[a].emplace_back(b);
    }
    for (int t = 0; t < n; t++) {
        queue<int> que;
        vector<bool> was(n);
        vector<int> depth(n);
        vector<set<int>> p(n);
        vector<int> q(n);
        que.push(t);
        was[t] = true;
        while (!que.empty()) {
            for (int i = que.size(); i > 0; i--) {
                int v = que.front();
                que.pop();
                set<int> st;
                for (int to : g[v]) {
                    if (was[to]) {
                        st.emplace(to);
                        continue;
                    }
                    was[to] = true;
                    que.push(to);
                    depth[to] = depth[v] + 1;
                    p[to] = p[v];
                    q[to] = v;
                    p[to].emplace(v);
                }
                if (!st.empty()) {
                    int mx = -1, id = -1;
                    for (int to : st) {
                        if (p[v].count(to)) {
                            if (mx < depth[to]) {
                                id = to;
                                mx = depth[to];
                            }
                        }
                    }
                    if (id != -1) {
                        cout << depth[v] - mx + 1 << '\n';
                        cout << v + 1 << '\n';
                        while (id != v) {
                            v = q[v];
                            cout << v + 1 << '\n';
                        }
                        return 0;
                    }
                }
            }
        }
    }
    cout << -1 << '\n';
    return 0;
}

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

typedef long long int ll;
#define all(x) (x).begin(), (x).end()

using namespace std;

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

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

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

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

    // Print all prime numbers
    for (int p=2; p<=n; p++)
       if (prime[p])
          primes.push_back(p);
}

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

ll power(ll x, ll y,ll mod)
{
    ll temp;
    if( y == 0)
        return 1;
    temp = power(x, y/2,mod);
    if (y%2 == 0)
        return (temp*temp)%mod;
    else
        return (((x*temp)%mod)*temp)%mod;
}

vector <vector <int> > g;
void dfs(int s,vector <int> &p,int &parent,int &child,set <int> &s2,vector <bool> &visited,vector <int> &depth,int &min,vector <int> &path);

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt(),m=nxt();
    vector <int> row;
    g.resize(n+1,row);

    set <pair<int,int> > edges;
    for(int i=0;i<m;i++)
    {//cout<<"came3\n";
        int u=nxt(),v=nxt();
        g[u].push_back(v);
        edges.insert({u,v});
    }

    vector <int> p(n+1);
    int parent=0,child=0,min=INT_MAX;
    vector <int> path(n+1);
    for(int i=1;i<=n;i++)
    {//cout<<"came"<<endl;
        vector <bool> visited;
        visited.resize(n+1,0);
        set <int> s2;
        vector <int> depth(n+1);
        depth[i]=0;
        dfs(i,p,parent,child,s2,visited,depth,min,path);

    }

    if(parent!=0)
        {
            vector <int> test;
            int cur=child;
            test.push_back(cur);
            //cout<<cur<<" "<<parent<<endl;
            //return 0;
            while(cur!=parent)
            {//cout<<cur<<endl;
                cur=path[cur];
                test.push_back(cur);
            }
            cout<<test.size()<<endl;
            for(auto val:test)
                cout<<val<<endl;
            return 0;
        }
    cout<<"-1\n";

    return 0;
}

void dfs(int s,vector <int> &p,int &parent,int &child,set <int> &s2,vector <bool> &visited,vector <int> &depth,int &min,vector <int> &path)
{
    visited[s]=1;
    int x=s;
    s2.insert(x);
        for(int i=0;i<g[x].size();i++)
        {
            if(!visited[g[x][i]])
            {
                p[g[x][i]]=x;
                depth[g[x][i]]=depth[x]+1;
                dfs(g[x][i],p,parent,child,s2,visited,depth,min,path);

            }
            else{
                if(s2.count(g[x][i])&&(depth[x]-depth[g[x][i]])<min)
                {
                    child=x;
                    parent=g[x][i];
                    min=depth[x]-depth[g[x][i]];
                    path=p;
                }
            }
        }
    s2.erase(x);

}


#include<bits/stdc++.h>
using namespace std;
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    long long i,j,k,l,m,n,o,p,q;
    while(cin>>m>>n>>o>>p)
    {
        if(m+n>o+p)
            cout<<"Left"<<endl;
        else if(m+n<o+p)
            cout<<"Right"<<endl;
        else
            cout<<"Balanced"<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#include <iostream>
#include<math.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int left = A + B;
    int right = C + D;
    if (left > right) {
        cout << "Left" << endl;
    } else if (left < right) {
        cout << "Right" << endl;
    } else {
        cout << "Balanced" << endl;
    }
    return 0;
}


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

#define LL long long
#define LD long double
#define SC(t,x) static_cast<t>(x)
#define AR(t) vector < t >
#define PII pair < int, int >
#define PLL pair < LL, LL >
#define PIL pair < int, LL >
#define PLI pair < LL, int >
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define PRF first
#define PRS second
#define INIT(ar,val) memset ( ar, val, sizeof ( ar ) )
#define lp(loop,start,end) for ( int loop = start; loop < end; ++loop )
#define lpd(loop,start,end) for ( int loop = start; loop > end; --loop )
#define lpi(loop,start,end) for ( int loop = start; loop <= end; ++loop )
#define lpdi(loop,start,end) for ( int loop = start; loop >= end; --loop )
#define qmax(a,b) (((a)>(b))?(a):(b))
#define qmin(a,b) (((a)<(b))?(a):(b))
#define qabs(a) (((a)>=0)?(a):(-(a)))

const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 100007;

int n;
int a[MAXN];

void init ();
void input ();
void work ();

int getcur ()
{
	int cc = 0;
	lpi ( i, 1, n ) cc ^= ( a[i] - 1 ) & 1;
	return cc;
}

int gcd ( int x, int y )
{
	return y ? gcd ( y, x%y ) : x;
}

int main()
{
	init();
	input();
	work();
}

void init ()
{
	// Init Everything Here

	ios::sync_with_stdio ( false );
}

void input ()
{
	// input method

	scanf ( "%d", &n );
	lpi ( i, 1, n ) scanf ( "%d", &a[i] );
}

void work ()
{
	// main work

	if ( n == 1 ){
		cout << "Second" << endl;
		return;
	}else if ( n == 2 ){
		cout << ( ( ( a[1] ^ a[2] ) & 1 ) ? "First" : "Second" ) << endl;
		return;
	}

	if ( getcur () ) cout << "First" << endl;
	else{
		int t = 0, cc, g;
		while ( 1 ){
			cc = 0;
			if ( getcur () ){
				cout << ( t ? "Second" : "First" ) << endl;
				break;
			}
			lpi ( i, 1, n ) cc += a[i] & 1;
			if ( cc > 1 || ( *min_element ( a+1, a+1+n ) == 1 ) ){
				cout << ( t ? "First" : "Second" ) << endl;
				break;
			}
			lpi ( i, 1, n ) if ( a[i] & 1 ) --a[i];
			g = a[1];
			lpi ( i, 2, n ) g = gcd ( g, a[i] );
			lpi ( i, 1, n ) a[i] /= g;
			t ^= 1;
		}
	}
}

#include <bits/stdc++.h>

using namespace std;

const int N = 100010;
int a[N], n, cnt[2];

bool gao() {
  for (int i = 1; i <= n; i++)
    if (a[i] & 1) a[i]--;
  cnt[0] = cnt[1] = 0;
  int gcd = a[1];
  for (int i = 2; i <= n; i++) gcd = __gcd(a[i], gcd);
  for (int i = 1; i <= n; i++) cnt[(a[i] /= gcd) & 1]++;
  if (cnt[0] & 1)
    return 1;
  else if (cnt[1] > 1)
    return 0;
  else {
    for (int i = 1; i <= n; i++)
      if (a[i] == 1) return cnt[0] & 1 ? 1 : 0;
    return gao() ^ 1;
  }
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d", a + i), cnt[a[i] & 1]++;
  if (cnt[0] & 1)
    puts("First");
  else if (cnt[1] > 1)
    puts("Second");
  else {
    for (int i = 1; i <= n; i++)
      if (a[i] == 1) {
        puts(cnt[0] & 1 ? "First" : "Second");
        return 0;
      }
    puts(gao() ^ 1 ? "First" : "Second");
  }
  return 0;
}


#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <chrono>
#include <vector>
#include <map>
#include <random>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <deque>
#include <cassert>
#include <stack>
using namespace std;

#define mp make_pair
#define f first
#define se second
#define pb push_back
#define ppb pop_back
#define emb emplace_back
#define ll long long
#define ull unsigned long long
#define cntbit(x) __builtin_popcount(x)
#define endl '\n'
#define uset unordered_set
#define umap unordered_map
#define pii pair<int, int>
#define ld long double
#define pll pair<long long, long long>

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template <typename T> inline T range(T l, T r) {
    return uniform_int_distribution<T>(l, r)(rng);
}

inline void setin(string s) {
    freopen(s.c_str(), "r", stdin);
}

inline void setout(string s) {
    freopen(s.c_str(), "w", stdout);
}

template <typename T> void Min(T &a, T b) {
    a = min(a, b);
}

template <typename T> void Max(T &a, T b) {
    a = max(a, b);
}

const int inf = 0x3f3f3f3f;
const int mod = 998244353;
const int N = 3e2 + 15;
int n, k;
string s;
int dp[2][N][N]; // dp[i][operation_applied][free_ones]
int a[N], p[N][N];

inline int add(int a, int b) {
    a += b;
    if(a >= mod)
        a -= mod;
    if(a < 0)
        a += mod;
    return a;
}

inline void add_t(int &a, int b) {
    a = add(a, b);
}

inline void construct() {
    int sz = 1;
    for(int i = 1; i <= n && s[i] == '1'; ++i)
        a[1] = i;
    for(int i = a[1] + 1; i <= n; ++i) {
        if(s[i] == '0') {
            if(i + 1 <= n && s[i + 1] == '0')
                a[++sz] = 0;
        }
        else {
            int j = i;
            while(j + 1 <= n && s[j + 1] == '1')
                ++j;
            a[++sz] = j - i + 1;
            i = j;
        }
    }
    n = sz;
}

inline void solve() {
    // dp[i][operation_applied][free_ones]
    dp[(n + 1) & 1][0][0] = 1;
    int sum = 0;
    for(int i = n; i >= 1; --i) {
        int bit = i & 1;
        memset(dp[bit], 0, sizeof(dp[bit]));
        for(int k = 0; k < N; ++k)
            for(int t = 0; t < N; ++t)
                p[k][t] = add(k && t ? p[k-1][t-1] : 0, dp[bit ^ 1][k][t]);

        for(int k = 0; k < N; ++k) {
            int val = 0;
            for(int t = N - 1; t >= 0; --t) {
                add_t(dp[bit][k][t], val);
                if(k - a[i] - 1 >= 0 && t - a[i] - 1 >= 0)
                    add_t(dp[bit][k][t], add(p[k][t], -p[k - a[i] - 1][t - a[i] - 1]));
                else
                    add_t(dp[bit][k][t], p[k][t]);
                add_t(val, dp[bit ^ 1][k][t]);
            }
        }
        sum += a[i];
    }
}

inline void output() {
    int ans = 0;
    for(int i = 0; i < min(N, k + 1); ++i)
        add_t(ans, dp[1][i][0]);
    cout << ans << endl;
}

main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    // setin("input.txt");
    cin >> s >> k;
    n = s.size();
    s = '#' + s;
    construct();
    solve();
    output();
    return 0;
}

#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 100005
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll,ll>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

void test_case() {

    int n , r;
    cin>>n>>r;

    if(n >= 10) {
        cout<<r<<endl;
        return;
    }

    int ans = r + 100*(10-n);

    cout<<ans<<endl;

}

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

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

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


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
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*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    double n, m, d;
    cin >> n >> m >> d;

    if(d == 0){
        cout << (m-1)/n << endl;
        return 0;
    }
    double a = m-1;
    double b = 2*(n-d);
    double c = n*n;
    cout << a*b/c << endl;
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <stack>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右下左上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, -1 };
constexpr int dy[] = { 0, 1, 0, -1, 1, 1 };

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

    // 標準出力
    void Write(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Write(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T, typename U> void Write(const T& x, const U& y, const char* end = "\n") { std::cout << x << " " << y << end; }
    template <typename T, typename U, typename V> void Write(const T& x, const U& y, const V& z, const char* end = "\n") { std::cout << x << " " << y << " " << z << end; }
    //template <typename... Args> void Write(Args const&... args) { bool a = true; for (auto const& x : { args... }) { if (a) a = false; else std::cout << " "; std::cout << x; } std::cout << "\n"; }
    template <typename T> void Write(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; ++i) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }
    template <typename T> void Write(const std::vector<std::vector<T>>& x, const char* sep = " ", const char* end = "\n") { for (auto v : x) Write(v, sep, end); }

    // 標準入力
    struct Read {
        std::size_t szi, szj;
        Read(std::size_t _szi = 1, std::size_t _szj = 1) : szi(_szi), szj(_szj) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { std::vector<T> a(szi); for (std::size_t i = 0; i < szi; ++i) std::cin >> a[i]; return a; }
        template <typename T> operator std::vector<std::vector<T>>() const {
            std::vector<std::vector<T>> a(szi, std::vector<T>(szj));
            for (std::size_t i = 0; i < szi; ++i) for (std::size_t j = 0; j < szj; ++j) cin >> a[i][j]; return a;
        }
        template <typename T, typename U> operator std::vector<std::pair<T, U>>() const {
            std::vector<std::pair<T, U>> a(szi);
            for (std::size_t i = 0; i < szi; ++i) std::cin >> a[i].first >> a[i].second; return a;
        }
    };
    struct Reads {
        template <typename T> Reads(T& a) { std::cin >> a; }
        template <typename T, typename U> Reads(T& a, U& b) { std::cin >> a >> b; }
        template <typename T, typename U, typename V> Reads(T& a, U& b, V& c) { std::cin >> a >> b >> c; }
        template <typename T, typename U, typename V, typename W> Reads(T& a, U& b, V& c, W& d) { std::cin >> a >> b >> c >> d; }
    };

    Read read;
}

int main() {

    int n, m, d; Reads(n, m, d);

    double ans;

    // 隣同士の差がdであるものの個数の平均

    ans = (double)((n - d) * 2) / (n * (double)n) * (m - 1);
    if (d == 0) ans /= 2.0;

    cout << fixed << setprecision(8) << ans << endl;

    return 0;
}


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

#define F first
#define S second
#define PB push_back

using namespace std;

const int MAXN = 10005;
int sz[MAXN], par[MAXN];
vector<pair<int, pair<int, int> > > e;

int getpar(int x)
{
	if(par[x] == -1)
		return x;
	return par[x] = getpar(par[x]);
}

bool add(int x, int y)
{
	x = getpar(x), y = getpar(y);
	if(x == y)
		return false;
	if(sz[x] < sz[y])
		swap(x, y);
	sz[x] += sz[y];
	par[y] = x;
	return true;
}

int main()
{
	int n, m;
	cin >> n >> m;
	fill(par, par + n, -1);
	fill(sz, sz + n, 1);
	for(int i = 0; i < m; i++)
	{
		int x, y, w;
		cin >> x >> y >> w;
		e.PB({w, {x, y}});
	}
	sort(e.begin(), e.end());
	int ans = 0;
	for(auto x : e)
		if(add(x.S.F, x.S.S))
			ans += x.F;
	cout << ans << endl;
	return 0;
}

#include <iostream>
#include <algorithm>
#include <queue>

using namespace std;

long long int INF = 1000000000000LL;
#define MAX_V 120000

struct edge{
  long long int to, cost;
};

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

vector<edge> G[MAX_V];
long long int d[MAX_V];

void shortest_path(int s, int V){
  priority_queue<P, vector<P>, greater<P> > que;
  for(int i = 0; i < V; i++){
    d[i] = INF;
  }
  d[s] = 0;
  que.push(P(0, s));

  while(!que.empty()){
    P p = que.top();
    que.pop();
    int v = p.second;
    if(d[v] < p.first){
      continue;
    }
    for(int i = 0; i < G[v].size(); i++){
      edge e = G[v][i];
      if(d[e.to] > e.cost + d[v]){
        d[e.to] = d[v] + e.cost;
        que.push(P(d[e.to], e.to));
      }
    }
  }
}

int main(){
  int V, E, s;
  cin >> V >> E >> s;

  for(int i = 0; i < E; i++){
    int u, v, cost;
    edge e;
    cin >> u >> v >> cost;
    e.cost = cost;
    e.to = v;
    G[u].push_back(e);
  }

  shortest_path(s, V);

  for(int i = 0; i < V; i++){
    if(d[i] == INF){
      cout << "INF" << endl;
    }else{
      cout << d[i] << endl;
    }
  }

  return 0;
}


#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b, c, d, tmp, m, h, w, x, y, sum[ohara], k, q;

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

  cin >> n;
  rep(i, n) cin >> a[i], sum[i] = a[i];
  rrep(i, 1, n) sum[i] += sum[i - 1];

  ans = LINF;
  rrep(i, 1, n - 2) {
    ll peace1, peace2, peace3, peace4, dis;

    ll le = 0, ri = i - 1, mid;
    while (ri - le > 1) {
      mid = (le + ri) / 2;
      if (sum[mid] >= sum[i] - sum[mid])
        ri = mid;
      else
        le = mid;
    }

    dis = LINF;
    rrep(j, le, ri + 1) {
      if (dis >= abs(sum[j] - (sum[i] - sum[j]))) {
        dis = abs(sum[j] - (sum[i] - sum[j]));
        peace1 = sum[j];
        peace2 = sum[i] - sum[j];
      }
    }

    le = i + 1, ri = n - 2, mid;
    while (ri - le > 1) {
      mid = (le + ri) / 2;
      if (sum[mid] - sum[i] >= sum[n - 1] - sum[mid])
        ri = mid;
      else
        le = mid;
    }

    dis = LINF;
    rrep(j, le, ri + 1) {
      if (dis >= abs((sum[j] - sum[i]) - (sum[n - 1] - sum[j]))) {
        dis = abs((sum[j] - sum[i]) - (sum[n - 1] - sum[j]));
        peace3 = sum[j] - sum[i];
        peace4 = sum[n - 1] - sum[j];
      }
    }

    ans = min(ans, max({peace1, peace2, peace3, peace4}) -
                       min({peace1, peace2, peace3, peace4}));
  }
  Cout(ans);
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}

int main(){
    ll N;
    cin >> N;
    vector<ll> A(N), B(N), C(N);
    rep(i,N){
        cin >> A[i];
    }
    rep(i,N){
        if(A[i] > i){
            cout << -1 << endl;
            return 0;
        }
    }
    rep(i,N-1){
        if(A[i+1] - A[i] > 1){
            cout << -1 << endl;
            return 0;
        }
    }
    map<ll,ll> mp;
    rep(i,N){
        B[i] = i-A[i];
        mp[B[i]] = A[i];
    }
    rep(i,N-1){
        if(B[i+1] < B[i]){
            cout << -1 << endl;
            return 0;
        }
    }
    ll ans = 0;
    for(auto& e:mp){
        ans += e.second;
    }
    cout << ans
     << endl;
}


#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()

int get_int(){int x;scanf("%d",&x);return x;}

typedef long long ll;

const int mod = 998244353;
inline int mul(int x,int y){return 1ll*x*y%mod;}
int add(int x,int y) {return x+y>=mod?x+y-mod:x+y;}
int sub(int x,int y) {return x-y>=0?x-y:x-y+mod;}
int sq(int x){return 1ll*x*x%mod;}
int pows(int a,int b){return b == 0?1:(b&1?mul(a,sq(pows(a,b/2))):sq(pows(a,b/2)));}

const int maxn = 305;
int cnt[maxn*maxn];
int cnt2[maxn*maxn];

int sum;
int N;

void cal(int n,vector<int> &vi){
    cnt[0] = 1;
    cnt2[0] = 1;
    _for(i,0,N){
        int l = vi[i];
        for(int j = sum;j>=0;j--){
            cnt2[j] = add(cnt2[j],cnt2[j]);
            if(j-l >= 0) {
                cnt[j] = add(cnt[j],cnt[j-l]);
                cnt2[j] = add(cnt2[j],cnt2[j-l]);
            }
        }
    }
}

int main()
{
    vector<int> vi;
    N = get_int();
    _for(i,0,N){
        int num = get_int();
        sum += num;
        vi.push_back(num);
    }
    sort(ALL(vi));

    int ans = pows(3,N);
    //printf("all:%d\n",ans);

    cal(N,vi);
    //_rep(i,0,sum) printf("%d\n",cnt2[i]);

    _rep(i,(sum+1)/2,sum){
        ans = sub(ans,mul(3,cnt2[i]));
        //printf("%d\n",cnt2[i]);
    }

    if(!(sum&1)){
        ans = add(ans,mul(cnt[sum/2],3));
    }

     printf("%d\n",ans);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
    int n;
    cin >> n;
    cout << n/3 << endl;
}


#define _USE_MATH_DEFINES
#include <cmath>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<cctype>
#define rep(i,start,n) for(int i=start;i<n;i++)
#define And &&
#define Or ||
#define Lb cout<<endl
using namespace std;

int main(void) {
	string str; cin >> str;
	int q; cin >> q;
	string meirei, x;
	int a, b;
	rep(i, 0, q) {
		cin >> meirei;
		cin >> a >> b;
		if (meirei == "replace") {
			cin >> x;
			rep(j, 0, x.length()) {
				str[a + j] = x[j];
			}
		}
		else if (meirei == "reverse") {
			rep(j, 0, (b - a + 1) / 2) {
				char temp;
				temp = str[a + j];
				str[a + j] = str[b - j];
				str[b - j] = temp;
			}
		}
		else {
			rep(j, 0, (b - a + 1)) {
				cout << str[a + j];
			}
			cout << endl;
		}
	}
}

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

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

    int n;
    cin >> n;

    for(int i=0; i<n; ++i){
        string order;
        cin >> order;

        if( order == "print"){
            int a, b;
            cin >> a >> b;
            string sub = S.substr(a,b-a+1);
            cout << sub << endl;
        }else if( order == "reverse"){
            int a, b;
            cin >> a >> b;
            reverse(S.begin()+a, S.begin()+b+1);
        }if( order == "replace"){
            int a, b;
            string r;
            cin >> a >> b >> r;
            S.replace(a, b-a+1, r);
        }

    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

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

  int n, k;
  cin >> n >> k;

  priority_queue<int, vector<int>, greater<int>> pq;

  for (int i = 0; i < n; ++i) {
    int x; cin >> x;

    if (pq.size() < k) pq.push(x);
    else if (pq.size() >= k && x > pq.top()) {
      pq.pop();
      pq.push(x);
    }
  }

  int res = 0;
  while (!pq.empty()) {
    res += pq.top(); pq.pop();
  }

  cout << res << "\n";
}

    /**   Created by: Marcos Portales
          Codeforces User: marcosportales
          Country: Cuba
          Copyright                    */
#include<bits/stdc++.h>
using namespace std;
/// Pragmas:
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX
/// Macros:
#define int long long
#define f first
#define s second
#define db(x) cerr << #x << ": " << (x) << '\n';
#define pb push_back
#define lb lower_bound
#define up upper_bound
#define all(x) x.begin() , x.end()
#define rall(x) x.rbegin() , x.rend()
#define enl '\n'
#define vi vector<int>
#define sz(a) int((a).size())
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,x,y) for(int i=(x);i<(y);i++)
typedef pair<int,int> ii;
typedef long double ld;
typedef unsigned long long ull;
/// Constraints:
const int maxn = 400010;
const int mod = 1000000007;
const ld eps = 1e-9;
const int inf = ((1ll<<31ll)-1ll);
const int INF = 2000000000000000000ll;
const ld pi = acos(-1);
/// Prime Numbers:
// 2, 173, 179, 181, 197, 311, 331, 737, 1009, 2011, 2027, 3079, 4001, 10037, 10079, 20011, 20089;
// 100003, 100019, 100043, 200003, 200017, 1000003, 1000033, 1000037, 1000081;
// 2000003, 2000029, 2000039, 1000000007, 1000000021, 2000000099;
/// Functions:
#define lg2(x) 31 - __builtin_clz(x)
#define lgx(x,b) ( log(x) / log(b) )
/// Red-Black Tree Test.insert(x)late ---------------------------------
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree < long long ,  null_type ,  less<long long> ,  rb_tree_tag ,  tree_order_statistics_node_update > ordered_set;
/// Quick Pow------------------------------------------------
int qpow(int b,int e){
    if( !e ) return 1;
    if( e & 1 ) return qpow(b,e-1) * b % mod;
    int pwur = qpow(b,e>>1);
    return (pwur * pwur) % mod;
}
int modinv(int x){
    return qpow(x,mod-2);
}
/// My Code -------------------------------------------------

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout.setf(ios::fixed); cout.precision(0);
    srand(time(NULL));
    //freopen("a.in","r",stdin);
    //freopen("a.in","w",stdout);
    int n,k;
    cin>>n>>k;
    vi v(n);
    rep(i,n){
        cin>>v[i];
    }
    sort(rall(v));
    int ans=0;
    rep(i,k){
        ans+=v[i];
    }
    cout<<ans;

    return 0;
}