#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}

static void ABC096D();

#if 1
int main()
{
	ABC096D();
	fflush(stdout);
	return 0;
}
#endif

template <class _T> void tp_getPrimes(_T targ, std::map<_T, _T>& primes)
{
	_T target = targ;
	_T i = 2;
	while ((i * i) <= target) {
		if ((target % i) == 0) {
			target /= i;
			primes[i]++;
		}
		else {
			i++;
		}
	}
	if (target > 1) {
		primes[target]++;
	}
}

static void ABC096D()
{
	int N;
	getint(N);

	std::vector<int> primeNumbers;

	for (int i = 2; i <= 55555; i++) {
		std::map<int, int> primes;
		tp_getPrimes<int>(i, primes);
		if ((primes.size() == 1) && (primes.begin()->second == 1)){
			primeNumbers.push_back(primes.begin()->first);
		}
	}

	int count = 0;
	std::vector<int> ans(N);
	auto it = primeNumbers.begin();
	while ((it != primeNumbers.end()) && (count < N)) {
		if ((*it % 5) == 1) {
			ans[count] = *it;
			count++;
		}
		it++;
	}
	std::string str;
	for (int i = 0; i < N; i++) {
		char tmp[16] = { 0 };
		sprintf(tmp, "%d", ans[i]);

		if (i) {
			str += ' ';
		}
		str += tmp;
	}
	printf("%s\n", str.c_str());
}

#include <bits/stdc++.h>

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    vector<int64_t> ans;
    for (auto i : irange(2L, 55556L)) {
        if (i % 5 != 1) {
            continue;
        }

        bool ok = true;
        for (auto j = 2L; j * j <= i; ++j) {
            if (i % j == 0) {
                ok = false;
                break;
            }
        }

        if (ok) {
            ans.push_back(i);
        }

        if (ans.size() == n) {
            break;
        }
    }

    const auto* delim = "";
    for (auto a : ans) {
        cout << delim << a;
        delim = " ";
    }
    cout << endl;
}


#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long A, B;
    cin >> A >> B;
    ll count=0;
    ll input=1;
    while(input < B)
    {
        input--;
        input+=A;
        count++;
    }
    cout << count << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <algorithm>
#define rep(i,st,ed) for (int i=st;i<=ed;++i)

typedef long long LL;
const int MOD=998244353;
const int N=2000005;

LL fac[N],inv[N];

void upd(LL &x,LL v) {
	x+=v; (x>=MOD)?(x-=MOD):0;
}

void pre() {
	fac[0]=fac[1]=inv[0]=inv[1]=1;
	rep(i,2,N-1) {
		fac[i]=fac[i-1]*i%MOD;
		inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
	}
	rep(i,2,N-1) inv[i]=inv[i]*inv[i-1]%MOD;
}

LL ksm(LL x,LL dep) {
	LL res=1;
	for (;dep;dep>>=1) {
		(dep&1)?(res=res*x%MOD):0;
		x=x*x%MOD;
	}
	return res;
}

LL C(int n,int m) {
	return fac[n]*inv[m]%MOD*inv[n-m]%MOD;
}

int main(void) {
	pre(); int n,m;
	scanf("%d%d",&n,&m);
	if (n>m) std:: swap(n,m);
	LL ans=0;
	rep(i,1,n) upd(ans,C(i+i,i)*C(n+m-i*2,n-i)%MOD);
	ans=ans*ksm(C(n+m,n)*2%MOD,MOD-2)%MOD;
	upd(ans,m); printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//(a+b-1)/b

signed main(){
	string s; cin>>s;
	int n; cin>>n;
	string ans;
	rep(i,0,s.size()){
		if(i%n==0)ans.push_back(s[i]);
	}
	cout<<ans<<endl;
	return 0;
}

///بِسْمِ الّٰلهِ الرَّحْمٰنِ الرَحِيْمِ
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1.0)
int main()
{
     ios_base::sync_with_stdio(false);cin.tie(NULL);
     ll int i,n,t,j=0,p,x,a=0,b,l=0,r=0,y,k,c,sum=0,m,d;
     cin>>a>>b;
     l=max(a,b);
     r=min(a,b);
     p=16-(a+b);
     x=p/2;
     if(p%2==1){
        x++;
     }
     //cout<<x<<" "<<l-r<<endl;
     if((l-r)<=x){
        cout<<"Yay!"<<endl;
     }
     else{
        cout<<":("<<endl;

     }

     return EXIT_SUCCESS;
}


#include <bits/stdc++.h>

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N, M; cin >> N >> M;
    int A[N]; rep(i, N) cin >> A[i];
    int B[M]; rep(j, M) cin >> B[j];
    sort(A, A+N); reverse(A, A+N);
    sort(B, B+M); reverse(B, B+M);
    int idx_A = 1, idx_B = 1;
    ll ans;
    rep(i, N-1){
        if(A[i] == A[i+1]){
            cout << 0 << endl;
            return 0;
        }
    }
    rep(i, M-1){
        if(B[i] == B[i+1]){
            cout << 0 << endl;
            return 0;
        }
    }

    if(A[0] == B[0] && A[0] == N*M){
        ans = 1;
        ll op = N*M-1;
        ll tate = 1, yoko = 1;
        ll kouten = 1, put_kouten = 1;
        while(idx_A < N || idx_B < M){
            if(idx_A == N){
                if(op > B[idx_B]){
                    ans = (ans * (kouten-put_kouten)) % mod;
                    put_kouten++;
                }
                else{
                    kouten += yoko; tate++;
                    ans = (ans * yoko) % mod;
                    put_kouten++;
                    idx_B++;
                }
            }
            else if(idx_B == M){
                if(op > A[idx_A]){
                    ans = (ans * (kouten-put_kouten)) % mod;
                    put_kouten++;
                }
                else{
                    kouten += tate; yoko++;
                    ans = (ans * tate) % mod;
                    put_kouten++;
                    idx_A++;
                }
            }
            else{
                if(op > A[idx_A] && op > B[idx_B]){
                    ans = (ans * (kouten-put_kouten)) % mod;
                    put_kouten++;
                }
                else if(op == A[idx_A] && op == B[idx_B]){
                    //一意に決まる
                    kouten += tate; yoko++;
                    kouten += yoko; tate++;
                    put_kouten++;
                    idx_A++; idx_B++;
                }
                else if(op == A[idx_A]){
                    kouten += tate; yoko++;
                    ans = (ans * tate) % mod;
                    put_kouten++;
                    idx_A++;
                }
                else{
                    kouten += yoko; tate++;
                    ans = (ans * yoko) % mod;
                    put_kouten++;
                    idx_B++;
                }
            }
            op--;
        }
        //1以上op以下の数は好きなとこにおける -> ans *= fac[op];
        ll fac[op+1]; fac[0] = 1;
        rep(i, op){
            fac[i+1] = (fac[i]*(i+1)) % mod;
        }
        ans = (ans * fac[op]) % mod;
    }
    else{
        ans = 0;
    }
    cout << ans << endl;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(void) {
    constexpr long MOD = 1e9 + 7;

    long n, m;
    cin >> n >> m;
    vector<long> a(n), b(m);
    for(auto &e: a) cin >> e;
    for(auto &e: b) cin >> e;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    long x = 0, y = 0;

    auto aidx = [&](long x) {
        auto i = lower_bound(a.begin(), a.end(), x) - a.begin();
        return a[i] == x ? i : -1;
    };
    auto bidx = [&](long x) {
        auto i = lower_bound(b.begin(), b.end(), x) - b.begin();
        return b[i] == x ? i : -1;
    };

    long r = 1;
    for(int i=m*n; i>=1; i--) {
        long ai = aidx(i), bi = bidx(i);

        if(ai>=0 && bi>=0) {
            x++, y++;
            continue;
        }

        if(ai>=0) {
            x++;
            r *= y, r %= MOD;
            continue;
        }

        if(bi>=0) {
            y++;
            r *= x, r %= MOD;
            continue;
        }

        r *= x*y - (m*n - i), r %= MOD;
    }

    cout << r << endl;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
typedef long long ll;
long long mod = 1e9 + 7;
const int iINF = 0x3f3f3f3f;
const long long INF = 1LL << 60;

using namespace std;
using pint = pair<int, int>;

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 n, k;
  cin >> n >> k;
  vector<int> a(200005);

  rep(i, n)
  {
    cin >> a[i];
  }

  rep(i, min(50, k))
  {

    vector<int> b(200005, 0);
    rep(j, n)
    {
      // 累積和
      int left = max(0, j - a[j]);
      int right = min(n - 1, j + a[j]);
      // cout << "===" << endl;
      // cout << left << right << endl;

      b[left]++;
      b[right + 1]--;
    }

    // cout << b[0] << " ";
    repi(i, 1, n)
    {
      // cout << b[i] << " ";
      b[i] += b[i - 1];
    }
    // cout << endl;
    a = b;
  }

  rep(i, n)
  {
    cout << a[i] << " ";
  }

  return 0;
}

#include <cstdio>
#include <algorithm>

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

using namespace std;

int n, p;
int x[50];

int main(){
	while(scanf("%d%d", &n, &p), n){
		int c = 0;
		int q = p;
		while(1){
			if(q > 0){
				++x[c];
				--q;
				if(x[c] == p){
					printf("%d\n", c);
					break;
				}
			}
			else{
				q += x[c];
				x[c] = 0;
			}
			c = (c + 1) % n;
		}

		rep(i, n){
			x[i] = 0;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define loop(times) for(int i=0;i<(times);i++)

using namespace std;

int main() {
    while(1<2){
    int n;
    long long max;
    cin>>n;
    if(n==0)break;
    int a[n];
    int s[n];

    loop(n)cin>>a[i];
    max=a[0];
    s[0]=a[0];

    loop(n)s[i+1]=s[i]+a[i+1];
    for(int k=0;k<n;k++){
     loop(n-k){
         if(max<=s[k+i]-s[k-1])max=s[k+i]-s[k-1];
    }
    }
    cout<<max<<endl;
    }
}

#include <iostream>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    while(cin>>n, n) {
        int now, max;
        cin>>now;
        max=now;
        for(int i=1; i<n; i++) {
            int t;
            cin>>t;
            if(now<=0) now=t;
            else now+=t;
            if(max<now) max=now;
        }
        cout<<max<<'\n';
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
using namespace std;
void read(int &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void read(ll &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void Min(int &x,int y){
	if (x>y)x=y;
}
void Min(ll &x,ll y){
	if (x>y)x=y;
}
void Max(int &x,int y){
	if (x<y)x=y;
}
void Max(ll &x,ll y){
	if (x<y)x=y;
}

#define bas 50
ll cnt[105][105];
char s[50];
int main(){
//	freopen("1.in","r",stdin);
	int n,i,j,k,l;
	ll x,res=0;

	read(n);
	/*
		cnt2[i]+cnt2[j]>=0
		cnt5[i]+cnt5[j]>=0
	*/
	int m,ct2,ct5;
	for (i=1;i<=n;i++){
		scanf("%s",s);
		m=strlen(s);
		x=0; ct2=ct5=0;
		for (j=0;j<m;j++){
			if (s[j]!='.'){
				x=(x<<1)+(x<<3)+(s[j]^48);
			}
			else{
				ct2-=m-j-1;
				ct5-=m-j-1;
			}
		}
		for (;x&&x%2==0;)x/=2,ct2++;
		for (;x&&x%5==0;)x/=5,ct5++;
		cnt[bas+ct2][bas+ct5]++;
		if (ct2>=0&&ct5>=0)res--;
//		printf("%d %d\n",ct2,ct5);
	}
	for (i=-50;i<=50;i++){
		for (j=-50;j<=50;j++)if (cnt[i+bas][j+bas]){
			for (k=-i;k<=50;k++){
				for (l=-j;l<=50;l++){
					res+=cnt[i+bas][j+bas]*cnt[k+bas][l+bas];
				}
			}
		}
	}
	printf("%lld\n",res/2);
	return 0;
}

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

const long long B = 1e9;

int n;
int f[25][25];

int calc(long long t) {
    int x = 0, y = 0;
    while (t % 2 == 0) { ++ x; t /= 2; }
    while (t % 5 == 0) { ++ y; t /= 5; }

    x = max(0, 18 - x);
    y = max(0, 18 - y);

    //assert(t == 1);

    int ans = 0;
    for (int i = x; i <= 20; ++i)
        for (int j = y; j <= 20; ++j) ans += f[i][j];
    return ans;
}

void inc(long long t) {
    int x = 0, y = 0;
    while (t % 2 == 0) { ++ x; t /= 2; }
    while (t % 5 == 0) { ++ y; t /= 5; }

    x = min(x, 18);
    y = min(y, 18);

    ++ f[x][y];
}

int main() {
#ifdef Wearry
    freopen("in", "r", stdin);
#endif

    long long ans = 0;
    scanf("%d", &n);
    while (n--) {
        double a;
        scanf("%lf", &a);

        long long temp = (long long) round(a * B);
        ans += calc(temp);
        inc(temp);
    }
    printf("%lld\n", ans);

    return 0;
}


#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using namespace std;

const int bound = 1000*1000+10;
bool besucht[bound];

void init(){
	for( int i = 0; i < bound; ++i ) besucht[i] = false;
}

int no(){
	cout << 0 << endl;
	return 0;
}

int main(){
	int n, m; cin >> n >> m;
	vector<int> a(n);
	vector<int> b(m);
	for( auto &k : a ){
		cin >> k;
		if( besucht[k] ) return no();
		besucht[k] = true;
	}
	init();
	for( auto &k : b ){
		cin >> k;
		if( besucht[k] ) return no();
		besucht[k] = true;
	}
	sort( a.begin(), a.end() );
	sort( b.begin(), b.end() );
	ll ans = 1;
	for( int k = 1; k <= n*m; ++k ){
		bool ares = binary_search( a.begin(), a.end(), k );
		bool bres = binary_search( b.begin(), b.end(), k );
		ll comb = 1;
		if( !bres ) comb *= (b.end() - lower_bound( b.begin(), b.end(), k ));
		if( !ares ) comb *= (a.end() - lower_bound( a.begin(), a.end(), k ));
		if( !ares && !bres ) comb -= n*m-k;
		ans *= comb;
		ans %= mod;
	}
	cout << ans << endl;
}

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

int main() {
    int N, M; cin >> N >> M;
    vector<int> A(N), B(M); unordered_map<int, int> a, b; bool ok = true;
    REP(i, 0, N) {
        cin >> A[i];
        if(a[A[i]]) ok = false;
        a[A[i]] = i + 1;
    }
    REP(i, 0, M) {
        cin >> B[i];
        if(b[B[i]]) ok = false;
        b[B[i]] = i + 1;
    }
    if (!ok) {
        cout << 0 << endl;
        return 0;
    }

    int count[N * M + 1] = {};
    REP(i, 0, N) {
        REP(j, 0, M) {
            count[min(A[i], B[j])]++;
        }
    }

    vector<int> acnt(N, 0), bcnt(M, 0);
    REP(i, 0, N) {
        REP(j, 0, M) {
            if (A[i] <= B[j]) acnt[i]++;
        }
    }
    REP(j, 0, M) {
        REP(i, 0, N) {
            if (A[i] >= B[j]) bcnt[j]++;
        }
    }

    ll ans = 1; int cnt = 0;
    for (int i = N * M; i > 0; i--) {
        cnt += count[i];
        if (a[i] && b[i]) {
            continue;
        } else if (a[i]) {
            ans = (ans * acnt[a[i] - 1]) % MOD;
        } else if (b[i]) {
            ans = (ans * bcnt[b[i] - 1]) % MOD;
        } else {
            ans = (ans * (cnt - (N * M - i))) % MOD;
        }
    }
    cout << ans << 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()
{
    string s;
    cin >> s;
    bool ok = true;
    if (s[0] != 'A')
        ok = false;
    int cnt = 0;
    for (int i = 2; i <= s.size() - 2; i++)
    {
        if (s[i] == 'C')
            cnt++;
    }
    if (cnt >= 2 || cnt == 0)
        ok = false;
    for (int i = 1; i < s.size(); i++)
    {
        if (s[i] == 'C')
            continue;
        if ('A' <= s[i] && s[i] <= 'Z')
            ok = false;
    }
    if (ok)
        cout << "AC" << endl;
    else
        cout << "WA" << endl;
    return 0;
}

#include <iostream>
#include <algorithm>
#include <string>
#include  <queue>
#include <vector>
#include  <cstdio>
#include <cstring>
#include<map>
#include<cmath>
#include<set>
//#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T mul(T p, T e, T M)
{
    ll ret = 0;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret + p) ;
        p = (p + p) ;
        if(ret>=M)ret-=M;
        if(p>=M)p-=M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}

template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}

#define  mx 200004
#define base 193ll

typedef pair<int,int >P;
//////////////////////////
////////////////////////
#define F(i,a,b) for(int i=a;i<b; i++)
#define LL long long
#define MX  200007
#define md 998244353ll
///////////////////////////
///////////////////////////
char ar[ MX +2], br [MX+2];
int main(){

    string s;
    cin>>s;
    if(s[0] != 'A'){
        PC("WA");
    }
    else {
        bool fl =0;
        int cnt = 0;
        for(int i = 1; i < s.size(); i++){
            if(s[i] >= 'A' && s[i] <= 'Z'){
                if(s[i] == 'C' && i >= 2 && i < s.size() - 1){

                    cnt++;
                }
                else fl = 1;
            }

        }
        if(fl || cnt != 1)PC("WA");
        else PC("AC");
    }
    NL;
    return 0;
}


/*
 * ALDS1_5_D.cpp
 *
 *  Created on: Apr 30, 2018
 *      Author: 13743
 */

#include<cstdio>

long mergeCount(int* A, int l, int r) {
	if(l+1 == r) {
		return 0;
	}
	int mid = (l + r) / 2;
	long c1 = mergeCount(A, l, mid);
	long c2 = mergeCount(A, mid, r);
	int n1 = mid - l;
	int n2 = r - mid;
	int A1[n1+1];
	int A2[n2+1];
	A1[n1] = 1000000001;
	A2[n2] = 1000000001;
	for(int i=0; i<n1; i++) {
		A1[i] = A[l+i];
	}
	for(int i=0; i<n2; i++) {
		A2[i] = A[mid+i];
	}
	int i1=0, i2=0;
	long cc = 0;
	for(int i=0; i<r-l; i++){
		if(A2[i2] < A1[i1]) {
			cc += n1 - i1;
			A[l+i] = A2[i2];
			i2++;
		}
		else {
			A[l+i] = A1[i1];
			i1++;
		}
	}
	return c1 + c2 + cc;
}

int main() {
	int n;
	int A[200000];

	scanf("%d", &n);
	for(int i=0; i<n; i++) {
		scanf("%d", &A[i]);
	}

	long cnt = mergeCount(A, 0, n);

	printf("%ld\n", cnt);
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int ans = 0;
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  sort(a.begin(), a.end());
  for (int i = 0 ; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        if (a[i] == a[j] || a[i] == a[k] || a[j] == a[k]) continue;
        if (a[i] + a[j] > a[k]) {
          ans++;
          //cout << a[i] << " " << a[j] << " " << a[k] << "\n";
        }
      }
    }
  }
  cout << ans << "\n";
}


#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()

using namespace std;

constexpr int INF = 1 << 30;
constexpr int MOD = 1000000007;

int bubble_sort(vector<int> &A) {
  int count = 0;
  auto flag = true;
  for (int i = 0; flag; ++i) {
    flag = false;
    for (int j = A.size() - 1; j >= 1; --j) {
      if (A[j] < A[j - 1]) {
        swap(A[j], A[j - 1]);
        flag = true;
        count++;
      }
    }
  }
  return count;
}

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  REP(i, N) cin >> A[i];
  auto count = bubble_sort(A);
  REP(i, N) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl << count << endl;
}

#include <cstdio>
#include <iostream>

using namespace std;

int INFTY = 1000000001;

long long merge(int A[], int left, int mid, int right) {
	int n1 = mid - left;
	int n2 = right - mid;

	int L[n1];
	int R[n2];

	for (int i = 0; i < n1; ++i) {
		L[i] = A[left + i];
	}

	for (int i = 0; i < n2; ++i) {
		R[i] = A[mid + i];
	}

	L[n1] = INFTY;
	R[n2] = INFTY;

	int i = 0;
	int j = 0;

	long long cnt = 0;

	for (int k = left; k < right; ++k) {
		if (L[i] <= R[j]) {
			A[k] = L[i];
			++i;
		} else {
			A[k] = R[j];
			++j;
			cnt += n1 - i;
		}
	}
	return cnt;
}

long long mergeSort(int A[], int left, int right) {

	if (left + 1 < right) {
		int mid = (left + right) / 2;

		long long v1 = mergeSort(A, left, mid);
		long long v2 = mergeSort(A, mid, right);
		long long v3 = merge(A, left, mid, right);

		return v1 + v2 + v3;
	} else {
		return 0;
	}

}

int main() {

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

	int A[n];
	for (int i = 0; i < n; ++i) {
		scanf("%d", &A[i]);
	}
	A[n] = INFTY;

	long long v = mergeSort(A, 0, n);

	cout << v << endl;

	return 0;
}


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

const int MAXN = 5e5 + 10;
const int MAX_NODE_CNT = MAXN << 6;

int n, m, lst[MAXN];

struct Persistent_Segment_Tree {
    #define mid ((l + r) >> 1)
    #define ls(_) t[_].ls
    #define rs(_) t[_].rs
    #define lq(_) t[_].ls, l, mid
    #define rq(_) t[_].rs, mid + 1, r
    int node_cnt, rt[MAXN];
    int& operator [](const int& x) { return rt[x]; }
    struct node { int ls, rs, data; } t[MAX_NODE_CNT];
    int build(int l, int r) {
        int cur = ++node_cnt;
        if (l == r) return cur;
        ls(cur) = build(l, mid), rs(cur) = build(mid + 1, r);
        return cur;
    }
    int modify(int pre, int l, int r, int pos, int val) {
        int cur = ++node_cnt; t[cur] = t[pre], t[cur].data += val;
        if (l == r) { return cur; }
        if (pos <= mid) ls(cur) = modify(ls(pre), l, mid, pos, val);
        else rs(cur) = modify(rs(pre), mid + 1, r, pos, val);
        return cur;
    }
    int query(int cur, int l, int r, int ql, int qr) {
        if (ql <= l && r <= qr) return t[cur].data;
        int ret = 0;
        if (ql <= mid) ret += query(lq(cur), ql, qr);
        if (qr > mid) ret += query(rq(cur), ql, qr);
        return ret;
    }
} t;

int main() {
    scanf("%d %d", &n, &m);
    t[0] = t.build(1, n);
    for (int i = 1, x; i <= n; ++i) {
        scanf("%d", &x); t[i] = t.modify(t[i - 1], 1, n, i, 1);
        if (lst[x]) t[i] = t.modify(t[i], 1, n, lst[x], -1);
        lst[x] = i;
    }
    int pre_ans = 0;
    for (int i = 1, u, v; i <= m; ++i) {
        scanf("%d %d", &u, &v);
        printf("%d\n", (t.query(t[v], 1, n, u, v)));
    }
    return 0;
}

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

//FenwickTree↓
int dat[N];
void init(){
    rep(i,N)dat[i]=0;
}
void add(int i,int x){
    for(;i<N;i+=i&-i)dat[i]+=x;
}
int sum(int i){
    int res=0;
    for(;i>0;i-=i&-i)res+=dat[i];
    return res;
}
int rangesum(int l,int r){//[l,r]
    return sum(r)-sum(l-1);
}
//FenwickTree↑

int a[N];
vector<int> ql[N],qid[N];
int ans[N];

int n,q,c[N];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin>>n>>q;
    for(int i=1;i<=n;i++)cin>>c[i];
    rep(i,q){
        int l,r;
        cin>>l>>r;
        ql[r].push_back(l);
        qid[r].push_back(i);
    }
    init();
    for(int i=1;i<=n;i++)a[i]=0;
    for(int i=1;i<=n;i++){
        if(a[c[i]]>0)add(a[c[i]],-1);
        add(i,+1);
        a[c[i]]=i;
        rep(j,ql[i].size()){
            ans[qid[i][j]]=rangesum(ql[i][j],i);
        }
    }
    rep(i,q)cout<<ans[i]<<"\n";
}


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

int e;

int main() {
  while (1) {
    scanf("%d", &e);
    if (e == 0) return 0;

    int ans = e;
    for (int z=0; z*z*z<=e; z++) {
      int z3 = z*z*z;
      for (int y=0; y*y+z3<=e; y++) {
        int y2 = y*y;
        ans = min(ans, y+z+e-y2-z3);
      }
    }

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

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int d;

    while (cin >> d) {
        int ans = 0;
        for (int a = d; a <= 600 - d; a += d) ans += a * a * d;
        cout << ans << endl;
    }
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>

using namespace std;

int main()
{
  char s[81];

  while(gets(s) != NULL){

    int len = strlen(s);

    if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
      cout << s << endl;
      continue;
    }

    for(int i = 0;i < 'z' - 'a';i++){
      for(int j = 0;j < len;j++){
	if(s[j] >= 'a' && s[j] <= 'z'){
	  if(s[j]+1 > 'z'){
	    s[j] = 'a';
	  }
	  else{
	    s[j]++;
	  }
	}
      }
      if(strstr(s,"this") || strstr(s,"that") || strstr(s,"the")){
	cout << s << endl;
	break;
      }
    }
  }
}

// D - Match Matching

// DPによる解法

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

string dp[10030]; // dp[i]: i本のマッチで作れる最大の数
int m[10] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};

string max_v(string v1, string v2) {
	if (v1.size() > v2.size()) return v1;
	if (v1.size() < v2.size()) return v2;

	if (v1 > v2) return v1;
	else return v2;
}

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

	vector<int> A;

	for (int i=0; i<M; i++) {
		int a;
		cin >> a;
		A.push_back(a);
	}

	for (int i=1; i<=N; i++) {
		dp[i] = "#";
	}

	for (int i=0; i<=N; i++) {
		for (int a : A) {
			if (dp[i] == "#") continue;

			dp[i+m[a]] = max_v(dp[i+m[a]], dp[i] + (char)('0' + a));
		}
	}

	cout << dp[N] << endl;

	/*
	// **** debug ****
	for (int i=0; i<=N; i++) {
		cout << dp[i] << endl;
	}
	*/

	return 0;
}


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

using namespace std;

using ll = long long;
using ld = long double;

const ld pi = 3.141592653589793;

int w[4];

int main() {
  for (int i = 0; i < 4; i++) {
    cin >> w[i];
  }

  if (w[0] + w[1] > w[2] + w[3]) {
    cout << "Left" << endl;
    return 0;
  }
  if (w[0] + w[1] == w[2] + w[3]) {
    cout << "Balanced" << endl;
    return 0;
  }

  if (w[0] + w[1] < w[2] + w[3]) {
    cout << "Right" << endl;
    return 0;
  }
}

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

typedef long long ll;

int a, b, c, d;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> a >> b >> c >> d;
    if (a + b > c + d) {
        cout << "Left" << endl;
    } else if (a + b < c + d) {
        cout << "Right" << endl;
    } else {
        cout << "Balanced" << endl;
    }

    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;

int partition(int *A, int p, int r){
    int x=A[r];
    int i=p-1;
    for(int j=p;j<r;j++){
        if(A[j]<=x){
            i++;
            int tmp=A[i];
            A[i]=A[j];
            A[j]=tmp;
        }
    }
    int tmp=A[i+1];
    A[i+1]=A[r];
    A[r]=tmp;

    return i+1;
}

int main(){
    int n, A[100000];
    cin >> n;
    for(int i=0;i<n;i++) cin >> A[i];

    int q = partition(A, 0, n-1);
    for(int i=0;i<q;i++){
        if(i>0) cout << ' ';
        cout << A[i];
    }
    cout << " [" << A[q] << ']';
    for(int i=q+1;i<n;i++) cout << ' ' << A[i];
    cout << endl;

    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

vector<int> Zalgorithm(vector<int> S) {
    vector<int> A(S.size());
    A[0] = S.size();
    int i = 1, j = 0;
    while (i < S.size()) {
        while (i+j < S.size() && S[j] == S[i+j]) ++j;
        A[i] = j;
        if (j == 0) { ++i; continue;}
        int k = 1;
        while (i+k < S.size() && k+A[k] < j) A[i+k] = A[k], ++k;
        i += k; j -= k;
    }
    return A;
}

int main() {
    int N;
    cin >> N;
    vector<int> a(N), b(N), S(3 * N);
    rep(i, N) cin >> a[i];
    rep(i, N) cin >> b[i];
    rep(i, N) {
        S[i] = b[i] ^ b[(i + 1) % N];
        S[N + i] = a[i] ^ a[(i + 1) % N];
        S[N + N + i] = a[i] ^ a[(i + 1) % N];
    }
    auto A = Zalgorithm(S);
    rep(i, N) {
        if (A[N + i] >= N) {
            cout << i << " " << (a[i] ^ b[0]) << "\n";
        }
    }
}


#include <iostream>
#include <set>

using namespace std;

class Solver {
  public:
    int n, m;
    int a[10000], b[10000];
    int solve() {
      set<int> friends, friends_friends;
      for (int i = 0; i < m; ++i) {
        if (a[i] == 1) {
          friends.insert(b[i]);
        }
      }
      for (set<int>::iterator iter = friends.begin(); iter != friends.end(); ++iter) {
        for (int i = 0; i < m; ++i) {
          if (a[i] == *iter && b[i] != 1 && friends.count(b[i]) == 0) {
            friends_friends.insert(b[i]);
          } else if (b[i] == *iter && a[i] != 1 && friends.count(a[i]) == 0) {
            friends_friends.insert(a[i]);
          }
        }
      }
      return friends.size() + friends_friends.size();
    }
};

int main() {
  Solver s;
  while (true) {
    cin >> s.n >> s.m;
    if (s.n == 0) {
      return 0;
    }
    for (int i = 0; i < s.m; ++i) {
      cin >> s.a[i] >> s.b[i];
    }
    cout << s.solve() << endl;
  }
}

#include <iostream>
using namespace std;

int main() {
	int n, p;

	while (1) {
		int flag = 0;
		int player[50] = { 0 };
		cin >> n >> p;
		if (n == 0 && p == 0) break;
		int p_max = p;

		while (1) {
			for (int j = 0; j < n; j++) {
				if (p != 0) player[j] += 1, p--;
				else p = player[j], player[j] = 0;
				if (player[j] == p_max) {
					flag = -1;
					cout << j << endl;
					break;
				}
			}
			if (flag == -1) break;
		}
	}
	return 0;
}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define EPS 1e-9
#define ll long long
#define Pll pair<ll, ll>
#define Pii pair<int, int>

using namespace std;
struct edge{int from, to; ll cost;};

int edit_distance(string s, string t){
    int n = (int)s.length(), m = (int)t.length();
    vector< vector<int> > dp(n+1, vector<int>(m+1, 1000000));
    dp[0][0] = 0;
    rep(n) dp[i+1][0] = i+1;
    rep(m) dp[0][i+1] = i+1;
    rep(n){
        repp(j, m){
            // replace
            if(s[i] == t[j]){
                dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j]);
            }else{
                dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + 1);
            }
            // insert
            dp[i+1][j+1] = min(dp[i+1][j+1], dp[i+1][j] + 1);
            // delete
            dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j+1] + 1);
        }
    }
    return dp[n][m];
}

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

    string s,t;
    cin >> s >> t;
    cout << edit_distance(s, t) << endl;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int k;
    string s;

    cin >> k >> s;

    if (s.size()>k) {
        string sub = s.substr(0, k);
        cout << sub << "..." <<endl;
    }
    else{
        cout << s <<endl;
    }

}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h,w;
    cin >> h >> w;
    vector<bool> a(h*w,false);

    queue<int> que;
    for(int i = 0; i < h; i++) {
        string tmp;
        cin >> tmp;
        for(int j = 0; j < w; j++) {
            int idx=i*w+j;
            if(tmp[j]=='#'){
                a[idx]=true;
                que.push(idx);
            }
        }
    }

    int cnt=0;
    int ans=0;
    while(cnt<h*w) {
        int n=que.size();
        cnt+=n;
        for(int i = 0; i < n; i++) {
            int idx=que.front();
            int add[4]={1,-1,w,-w};
            for(int j = 0; j < 4; j++) {
                int t=idx+add[j];
                int r=idx/w+add[j]/w;
                int c=idx%w+add[j]%w;
                if(r<0||r>=h||c<0||c>=w||a[t]==true) continue;
                a[t]=true;
                que.push(t);
            }
            que.pop();
        }
        ans++;
    }
    cout << ans-1 << "\n";

    return 0;
}

#include <bits/stdc++.h>
#define P pair<int, int>

using namespace std;
const int INF=1e5;

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

int main(){
  int h,w,a[1009][1009];
  string s[1009];
  cin >> h >> w;
  memset(a, -1, sizeof(a));
  for(int i=0;i<h;i++)cin >> s[i];
  queue<P> q;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]=='#'){
        a[i][j]=0;
        q.push(P(i,j));
      }
    }
  }
  int mx=0;
  while(!q.empty()){
    P p=q.front();q.pop();
    int ci=p.first;
    int cj=p.second;
    for(int i=0;i<4;i++){
      int ni=ci+dy[i];
      int nj=cj+dx[i];
      if(!(0<=ni&&ni<h&&0<=nj&&nj<w))continue;
      if(a[ni][nj]==-1){
        a[ni][nj]=a[ci][cj]+1;
        mx = max(mx, a[ni][nj]);
        q.push(P(ni, nj));
      }
    }
  }
  cout << mx << endl;
}


#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yes(){
    cout << "Yes" << endl;
}

void no (){
    cout << "No" << endl;
}

ll cel (ll a, ll b){
    if (a % b == 0) return a / b;
    else return a / b + 1;
}

ll gcds(ll a, ll b){
    ll c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int hen(vector<ll> p){
    int ans = 1;
    ll mi = p[1];
    rep(i,2){
        if (mi > p[i+2]){
            mi = p[i+2];
            ans = i+2;
        }
    }
    return ans;
}

int main() {
    int n; cin >> n;
    if (n == 1) cout << "Hello World" << endl;
    else if (n == 2){
        int a, b; cin >> a >> b;
        cout << a + b << endl;
    }
}

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

#include <iostream>
#include <fstream>

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>
#include <limits>
#include <iomanip>
using namespace std;
using ll = long long;
constexpr ll INF = 1010000000000000017LL;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(v) v.begin(), v.end()

ll GCD(ll a, ll b) { if(b==0) return a; else return GCD(b, a%b); }
ll LCM(ll a, ll b) { return a/GCD(a,b)*b; }

class AProgrammingEducation {
public:
	void solve(std::istream& in, std::ostream& out) {
        int n;in>>n;
        if(n==1){
            out<<"Hello World"<<endl;
        } else {
            int a,b;in>>a>>b;
            out<<a+b<<endl;
        }
	}
};

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


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll k;
int main(){
    scanf("%lld",&k);
    int n=50;
    vector<ll> v(n,n-1);
    for(int i=0;i<n;i++)v[i]+=k/n;
    for(int i=0;i<n;i++)v[i]-=k%n;
    for(int i=0;i<k%n;i++)v[i]+=n+1;
    printf("%d\n",n);
    for(int i=0;i<n;i++)printf("%lld ",v[i]);
    printf("\n");
    return 0;
}

#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define int long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(), (x).end()
#define capi(x) int x;cin>>x
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using vi = vector<int>;

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

#define P (1'000'000'007)

template<int MOD=P>
struct Mod {
public:
    long long signed value;

    Mod(long long signed val): value(val % MOD) {
        if (value < 0) value += MOD;
    }

    constexpr Mod& operator+=(const Mod& other) noexcept {
        value += other.value;
        value %= MOD;
        return *this;
    }
    constexpr Mod& operator-=(const Mod& other) noexcept {
        value -= other.value;
        if (value < 0) value += MOD;
        return *this;
    }
    constexpr Mod& operator*=(const Mod& other) noexcept {
        value *= other.value;
        value %= MOD;
        return *this;
    }

    constexpr Mod operator-() noexcept {
         return value == 0 ? 0 : MOD - value;
    }

    constexpr Mod operator+(const Mod& other) const noexcept { return Mod(*this) += other; }
    constexpr Mod operator-(const Mod& other) const noexcept { return Mod(*this) -= other; }
    constexpr Mod operator*(const Mod& other) const noexcept { return Mod(*this) *= other; }
    constexpr bool operator==(const Mod& other) const noexcept { return this->value == other.value; }
    constexpr bool operator!=(const Mod& other) const noexcept { return this->value != other.value; }
};

signed main() {
    capi(n);

    int d[61][2] = {0};

    rep(i, n) {
        capi(a);
        rep(j, 61) {
            ++d[j][a & 1];
            a >>= 1;
        }
    }

    Mod ans(0);

    rep(j, 61) {
        Mod x(1ll << j);
        x *= d[j][0] * d[j][1];
        ans += x;
    }

    cout << ans.value;

    return 0;
}


#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#define EPS 1e-10
using namespace std;
typedef long long llong;
void whatday(int m, int d) {
	int z;
	if (m == 1)z = d;
	else if (m == 2)z = 31 + d;
	else if (m == 3)z = 60 + d;
	else if (m == 4)z = 91 + d;
	else if (m == 5)z = 121 + d;
	else if (m == 6)z = 152 + d;
	else if (m == 7)z = 182 + d;
	else if (m == 8)z = 213 + d;
	else if (m == 9)z = 244 + d;
	else if (m == 10)z = 274 + d;
	else if (m == 11)z = 305 + d;
	else if (m == 12)z = 335 + d;
	if (z % 7 == 5)cout << "Monday" << endl;
	else if (z % 7 == 6 % 7)cout << "Tuesday" << endl;
	else if (z % 7 == 0 % 7)cout << "Wednesday" << endl;
	else if (z % 7 == 1 % 7)cout << "Thursday" << endl;
	else if (z % 7 == 2 % 7)cout << "Friday" << endl;
	else if (z % 7 == 3 % 7)cout << "Saturday" << endl;
	else if (z % 7 == 4 % 7)cout << "Sunday" << endl;
}
int main() {
	int m, d;
	while (cin >> m >> d&&m&&d) {
		whatday(m, d);
	}
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;

int N;

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

int day = 0, month = 0;

void input(void) {
	CI month >> day;
	return;
}

int main(void) {
	int weekday = 0;
	int y = 2004;

	string dayname[] = { "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" };
	while (true) {
		input();
		if (day == 0) {
			break;
		}
		if (month < 3) {
			y--; month += 12;
		}
		weekday =  (y + (y / 4) - (y / 100) + (y / 400) + (13 * month + 8) / 5 + day) % 7;
		y = 2004;
		CO dayname[weekday] E
	}

	return 0;
}


#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) sort(a.begin(), a.end(), [](int i, int j) -> bool { return abs(i) < abs(j); });
using namespace std;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using ll = long long;
double pi=3.14159265359;

//出力するよ
void output(vector<int> s)
{
    int n = s.size();
    for (int i = 0; i < n; i++)
    {
        if (i != 0)
            cout << " ";
        cout << s[i]; //<<endl;
    }
    cout << endl;
}

int MOD = pow(10, 9) + 7;

//各要素で最低操作回数を数える
pair<int,int> count(vector<int> a,vector<int> b){
    int n=a.size();
    int a_cnt=0,b_cnt=0;
    for(int i=0;i<n;i++){
        if(a[i]>b[i]){
            b_cnt+=(a[i]-b[i]);
        }
        if(a[i]<b[i]){
            if((b[i]-a[i])%2==0){
                a_cnt+=(b[i]-a[i])/2;
            }else{
                a_cnt+=(b[i]-a[i])/2 +1;
            }
        }
    }

    return make_pair(a_cnt,b_cnt);
}

signed main(){
    //スタックで処理することでいい感じに出来る。
    //STが作れたら上の要素をポップしていく。最終的にスタックの長さが答えになる。
    stack<char> st;
    string s; cin>>s;
    int n=s.length();

    for(int i=0;i<n;i++){
        //cout<<s[i]<<endl;
        if(st.size()==0) st.push(s[i]);
        else{
            char c=st.top();
            if(c=='S'&&s[i]=='T'){
                st.pop();
            }else st.push(s[i]);
        }
    }

    cout<<st.size()<<endl;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  string s;
  cin >> s;
  stack<char> stk;
  int co = 0;
  rep(i, s.size()){
    if(s.at(i) == 'S'){
      stk.push('S');
    }else{
      if(!stk.empty()){
        stk.pop();
        co++;
      }
    }
  }
  cout << s.size()-2*co << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef pair<int,int> int_pair;
typedef pair<ll,ll> ll_pair;
#define N 1002
#define INF 1e9+1

int Levenshtein(string s1,string s2){//hensyu kyori
	vector<vector<int> > dp;
	int ss1=s1.size(),ss2=s2.size();
	int n=max(ss1,ss2)+1;
	dp.resize(n);for(int i=0;i<n;i++)dp[i].resize(n);
	for(int i=0;i<ss1+1;i++)dp[i][0]=i;
	for(int i=0;i<ss2+1;i++)dp[0][i]=i;
	for(int i=1;i<ss1+1;i++){
		for(int j=1;j<ss2+1;j++){
			int a,b=1;
			if(s1[i-1]==s2[j-1])b=0;
			a=min(dp[i-1][j]+1,dp[i][j-1]+1);
			a=min(a,dp[i-1][j-1]+b);
			dp[i][j]=a;
		}
	}
	return dp[s1.size()][s2.size()];
}

string s1,s2;
int main(){
	cin>>s1>>s2;
	cout<<Levenshtein(s1,s2)<<endl;
	return 0;
}

#include <stdint.h>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
#include <vector>
#include <iostream>
#include <bitset>
#include <array>
#include <stdio.h>
using namespace std;

# define MAX 1000
uint64_t D0[MAX]={0}, HP[MAX]={0}, HN[MAX]={0}, VP[MAX]={0}, VN[MAX]={0};
uint64_t Cmap[MAX][20] = {};

int Mayer(size_t M, size_t N, string &a, string &b){
    unsigned int tmax = (M - 1) >> 6;
    unsigned int tlen = M - tmax * 64;
    // cout << "M:" << M << " " << "N:" << N << endl;
    // cout << "tmax:" << tmax << endl;
    // cout << "tlen:" << tlen << endl;

    for(size_t i = 0; i < tmax; ++i) {
        for(size_t j = 0; j < 64; ++j) Cmap[a[i * 64 + j]][i] |= (1L << j);
    }

    for(size_t i = 0; i < tlen; ++i){
        Cmap[a[tmax * 64 + i]][tmax] |= (1L << i);
        // printf("%c\n", a[tmax * 64 + i]);
    }

    int D = tmax * 64 + tlen;

    uint64_t top = (1L << (tlen - 1));
    uint64_t lmb = (1L << 63);
    for(size_t i = 0; i < tmax; ++i) VP[i] = ~0;
    for(size_t i = 0; i < tlen; ++i) VP[tmax] |= (1L << i);

    for(size_t i = 0; i < N; ++i) {
        uint64_t *PM = Cmap[b[i]];
        for(int r = 0; r <= tmax; ++r) {
            uint64_t X = PM[r];
            if(r > 0 && (HN[r - 1] & lmb)) X |= 1L;
            D0[r] = (((X & VP[r]) + VP[r]) ^ VP[r]) | X | VN[r];
            HP[r] = VN[r] | ~(D0[r] | VP[r]);
            HN[r] = D0[r] & VP[r];
            X = (HP[r] << 1L);
            if(r == 0 || HP[r - 1] & lmb) X |= 1L;
            VP[r] = (HN[r] << 1L) | ~(D0[r] | X);
            if(r > 0 && (HN[r - 1] & lmb)) VP[r] |= 1L;
            VN[r] = D0[r] & X;
        }
        if(HP[tmax] & top) ++D;
        else if(HN[tmax] & top) --D;
    }

    // free(D0), free(HP), free(HN), free(VP), free(VN);
    return D;
}

int main() {
    string str1, str2;
    std::cin >> str1 >> str2;
    if(str1.length() > str2.length()){
        string tmp = str1;
        str1 = str2;
        str2 = tmp;
    }

    // int res = edit_distance_fixed_<1000, string, 1000>(str1,str2);
    int res = Mayer(str1.length(), str2.length(), str1, str2);
    std::cout << res << std::endl;
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <numeric>
#include <iomanip>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10
#define MAX_N 20000
#define MAX_M 16

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

string s;
vector<P> p;//fi:pos  se:co

int main(){
	cin >> s;
	int ans = 0;
	int pos = 0;
	int co = 0;
	REP(i, s.size()){
		if (s[i] == 'O'){
			if (co == 0)pos = i;
			co++;
		}
		else if (co > 0){
			if (s[i] != 'O'){
				p.push_back(P(pos, co));
				co = 0;
			}
		}
	}
	if (co > 0)p.push_back(P(pos, co));
	REP(i, p.size()){
		int po = p[i].first;
		int w = p[i].second;
		//cout << po << " " << w << endl;
		bool f = 1;
		if (po - w >= 0){
			string t = s.substr(po - w, w);
			//cout << t << endl;
			REP(j, t.size()){
				if (t[j] != 'J')f = 0;
			}
		}
		else f = 0;
		if (po + w + w - 1 <= s.size() - 1){
			string t = s.substr(po + w, w);
			//cout << t << endl;
			REP(j, t.size()){
				if (t[j] != 'I')f = 0;
			}
		}
		else f = 0;
		if (f)ans = max(ans, w);
	}
	cout << ans << endl;
}

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

#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007
#define rev(v) reverse(v.begin(), v.end());

bool comp(int a, int b){
    return (a<b);
}

int main(){
    int n; cin >> n;
    int a, b;
    if(n==1) cout << "Hello World";
    else{
        cin >> a >> b;
        cout << a+b;
    }
    cout << endl;
    return 0;
}


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

// ----------- define --------------
#define int long long
#define vi vector<int>
#define vc vector<char>
#define ii pair<int,int>
#define fi first
#define sc second
#define stoi stoll
#define all(x) (x).begin(),(x).end()
#define get_bit(x, k) ((x >> k) & 1)
// ---------------------------------

void MAIN() {
  string s;
  cin >> s;
  set<char> d;
  for (char c = 'a'; c <= 'z'; c++) d.insert(c);
  for (auto &i : s) d.erase(i);
  if (d.size()) {
    s += *d.begin();
    cout << s << '\n';
    return;
  }
  set<char> g;
  while (s.size()) {
    char c = s.back();
    s.pop_back();
    auto it = g.upper_bound(c);
    if (it != g.end()) {
      s += *it;
      cout << s << '\n';
      return;
    }
    g.insert(c);
  }
  cout << -1 << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}

#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 <random>
#include <cassert>
#include <numeric>
#define ll long long int
#define LL unsigned long long
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;

ll y[10000005];

int main() {
    string s; cin >> s;
    int n = s.size();

    map<char,int> mp;
    rep(i,n) mp[s[i]]++;

    rep(i,26){
        if(!mp[char (i+97)]){
            cout << s + char(i+97) << endl;
            return 0;
        }
    }
    if(s == "zyxwvutsrqponmlkjihgfedcba") cout << -1 << endl;
    else {
        for(int i = n-1; i >= 1; i--){
            if(s[i-1] < s[i]){
                rep(j,i-1){
                    cout << s[j];
                }
                for(int j = n-1; j>=1;j--){
                    if(s[i-1] < s[j]){
                        cout << s[j];
                        return 0;
                    }
                }
                return 0;
            }
        }
    }
}


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int field[606][606][2];
int D[2];
int N;
vector<int> dx[2];
vector<int> dy[2];

void bfs(int x, int y, int index, int val) {
    if(x < 0 || x >= 2 * N || y < 0 || y >= 2 * N) return;
    if(field[x][y][index] != 0) return;
    field[x][y][index] = val;
    for(int i = 0; i < dx[index].size(); i++) {
        bfs(x+dx[index][i], y+dy[index][i], index, 3 - val);
    }
}

void print(vector<l_l> in) {
    for(int i = 0; i < N * N; i++) {
        cout << in[i].first << " " << in[i].second << endl;
    }
}

int main() {
    //cout.precision(10);
    cin >> N >> D[0] >> D[1];
    for(int index = 0; index < 2; index++) {
        for(int x = 0; x < 2 * N; x++) {
            for(int y = 0; y < 2 * N; y++) {
                if(x * x + y * y == D[index]) {
                    dx[index].push_back(x);
                    dx[index].push_back(x);
                    dx[index].push_back(-x);
                    dx[index].push_back(-x);
                    dy[index].push_back(y);
                    dy[index].push_back(-y);
                    dy[index].push_back(y);
                    dy[index].push_back(-y);
                }
            }
        }
    }
    for(int index = 0; index < 2; index++) {
        for(int x = 0; x < 2 * N; x++) {
            for(int y = 0; y < 2 * N; y++) bfs(x, y, index, 1);
        }
    }
    /*
    for(int index = 0; index < 2; index++) {
        for(int x = 0; x < 2 * N; x++) {
            for(int y = 0; y < 2 * N; y++) cerr << field[x][y][index] << " ";
            cerr << endl;
        }
        cerr << endl;
    }
    */
    vector<l_l> ans;
    for(int val = 1; val <= 2; val++) {
        ans.clear();
        for(int x = 0; x < 2 * N; x++) {
            for(int y = 0; y < 2 * N; y++) {
                if(field[x][y][0] == 1 && field[x][y][1] == val) ans.push_back({x, y});
            }
        }
        if(ans.size() >= N * N) {
            print(ans);
            return 0;
        }
    }
    return 0;
}

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

int n,D_1,D_2,cnt;

bool chk(int i,int j,int d){
	int u=__builtin_ctz(d);
	if(u&1)return!(i>>(u/2)&1);
	else return!((i^j)>>(u/2)&1);
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>D_1>>D_2;
	for(int i=0;i<2*n;++i)
		for(int j=0;j<2*n;++j)
			if(chk(i,j,D_1)&&chk(i,j,D_2)){
				cout<<i<<' '<<j<<'\n';
				if(++cnt>=n*n)return 0;
			}
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

int main(){

	int N,Q,M,Date[101],i,l,k;

	while(0<=scanf("%d%d",&N,&Q)){
		for(i=0;i<101;i++){
			Date[i]=0;
		}

		if((N==0) && (Q==0)){
			break;
		}

		for(k=0;k<N;k++){
			scanf("%d",&M);
			if(M==0){
				continue;
			}else{
				for(i=0;i<M;i++){
					scanf("%d",&l);
					++Date[l];
				}
			}
		}
		l=0;
		i=0;
		for(k=0;k<100;k++){
			if(i<Date[k] && Date[k]>=Q){
				i=Date[k];
				l=k;
			}
		}

		printf("%d\n",l);
	}

	return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;
typedef pair<int, string> PSI;

int n, q;
int m;

int main(){
	while (cin >> n >> q&&n + q){
		int num, ans = 0, ma = q;
		int cnt[100] = {};
		REP(i, n){
			cin >> m;
			REP(j, m){
				cin >> num;
				cnt[num]++;
			}
		}
		REP(i, 100){
			ma = max(ma, cnt[i]);
		}
		REP(i, 100){
			if (ma == cnt[i]){
				ans = i;
				break;
			}
		}
		cout << ans << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

typedef pair<double,string> pds;

bool hikaku(pds lhs,pds rhs){
  if(lhs.first>rhs.first) return true;
  else if(lhs.first==rhs.first)return lhs.second<rhs.second;
  else return false;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  while(cin>>n,n){
    string l;
    double p,a,b,c,d,e,f,s,m;
    vector<pds> v;
    for(int i=0;i<n;i++){
      cin >>l>>p>>a>>b>>c>>d>>e>>f>>s>>m;
      double eff=(f*s*m-p)/(a+b+c+m*(d+e));
      v.push_back(make_pair(eff,l));
      //cout<<eff<<" "<<l<<endl;
    }
    sort(v.begin(),v.end(),hikaku);
    for(int i=0;i<n;i++){
      cout << v[i].second <<endl;//<< " "<<v[i].first<< endl;
    }
    cout <<"#" << endl;
  }
}

#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

struct Info{
	char name[21];
	double seed_price,before_leaf,after_leaf,num,sell_price,count,rate;
};

//???????????????????????????3,left?????????????????´??????1,right?????????????????¨??????2
int strCmp2(char* left,char* right){
	int i;

	for(i=0;left[i] != '\0' && right[i] != '\0'; i++){
		if(left[i] != right[i]){
			if(left[i] < right[i])return 1;
			else{
				return 2;
			}
		}
	}
	if(left[i] == '\0')return 1;
	else{
		return 2;
	}
}

void func(int N){
	Info info[N];
	double A,B,C,D,E,sum,total_time;

	for(int loop = 0; loop < N; loop++){
		scanf("%s %lf %lf %lf %lf %lf %lf %lf %lf %lf",info[loop].name,&info[loop].seed_price,&A,&B,&C,&D,&E,&info[loop].num,&info[loop].sell_price,&info[loop].count);
		info[loop].before_leaf = A+B+C;
		info[loop].after_leaf = D+E;

		sum = 0;
		total_time = info[loop].before_leaf;
		for(int i = 0; i < info[loop].count; i++){
			total_time += info[loop].after_leaf;
			sum += info[loop].sell_price*info[loop].num;
		}
		sum -= info[loop].seed_price;
		info[loop].rate = sum/total_time;
	}

	for(int i = 1; i <= N-1; i++){
		for(int k = N-1; k >= i; k--){
			if(info[k].rate > info[k-1].rate)swap(info[k],info[k-1]);
			else if(info[k].rate == info[k-1].rate && strCmp2(info[k].name,info[k-1].name) == 1)swap(info[k],info[k-1]);
		}
	}

	for(int i = 0; i < N; i++)printf("%s\n",info[i].name);
	printf("#\n");

}

int main(){
	int N;

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func(N);
	}

}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 300 + 10;
typedef long long ll;
const ll mod = 998244353;
int tot, K;
char s[maxn];
int a[maxn];
ll f[maxn][maxn][maxn];
ll ans;
inline ll norm(const ll & x) { return x >= mod ? x - mod : x;}
int main()
{
	scanf("%s%d", s + 1, &K);
	K = min(K, 300);
	int len = strlen(s + 1);
	reverse(s + 1, s + len + 1);
	int cur = 0;
	for(int i = 1; i <= len; ++i)
		if(s[i] == '0')
		{
			a[++tot] = cur;
			cur = 0;
		}
		else
			++cur;
	a[++tot] = cur;
	f[0][0][0] = 1;
	for(int i = 1; i <= tot; ++i)
		for(int k = 0; k <= K; ++k)
		{
			for(int j = k; ~j; --j)
				f[i][j][k] = norm(f[i - 1][j][k] + f[i][j + 1][k]);
			for(int j = 0; j <= k; ++j)
			{
				/*
				for(int jd = j; jd <= k; ++jd)
					f[i][j][k] = (f[i][j][k] + f[i - 1][jd][k]) % mod;
				*/
				int lim = min(j, a[i]);
				for(int jd = 1; jd <= lim; ++jd)
					f[i][j][k] = norm(f[i][j][k] + f[i - 1][j - jd][k - jd]);
			}
		}
	for(int k = 0; k <= K; ++k)
		ans = norm(ans + f[tot][0][k]);
	cout << ans << endl;
	return 0;
}

#include <bits/stdc++.h>
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 998244353, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 4005;
int n, k, fac[N], ifac[N];
void add(int &x, int y) {
	x += y; if (x >= mod) x -= mod;
}
void rem(int &x, int y) {
	x -= y;
	if (x < 0) x += mod;
}
int mul(int x, int y) {
	return 1ll * x * y % mod;
}
int fpow(int a, int p) {
	if (!p) return 1;
	int tmp = fpow(a, p >> 1);
	tmp = mul(tmp, tmp);
	if (p & 1) tmp = mul(tmp, a);
	return tmp;
}
int inv(int a) {
	return fpow(a, mod - 2);
}
int C(int n, int k) {
	if (n < k || k < 0) return 0;
	return mul(fac[n], mul(ifac[k], ifac[n - k]));
}
int solve(int i, int tot) {
	int special = 0, vari = 0;
	fw (j, 1, k + 1) {
		int other = i - j;
		if (other > 0 && other <= k) {
			if (j < other) special++, vari++;
		} else vari++;
	}
	int ans = 0, curPow = 1;
	fw (j, 0, special + 1) {
		int cntWays = C(special, j);
		int cntLeft = vari - special;
		add(ans, mul(mul(cntWays, curPow), C(tot + cntLeft - 1, j + cntLeft - 1)));

		curPow = mul(curPow, 2);
	}
	return ans;
}
signed main() {
	#ifdef BLU
	in("blu.inp");
	#endif
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	fac[0] = ifac[0] = 1;
	fw (i, 1, N) {
		fac[i] = 1ll * fac[i - 1] * i % mod;
		ifac[i] = inv(fac[i]);
	}
	cin >> k >> n;
	fw (i, 2, 2 * k + 1) {
		int ans = 0;
		if (i & 1) {
			add(ans, solve(i, n));
		} else {
			fw (haveHalf, 0, 2) add(ans, solve(i, n - haveHalf));
		}
		cout << ans << "\n";
	}
	return 0;
}


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

int N;long long base=1000000007LL;

int main() {
  cin >> N;
  long long A[3][N];long long count=3LL;
  for (int i=0;i<N;i++) {
    for (int j=0;j<3;j++) {
      A[j][i]=0LL;
    }
  }
  for (int i=0;i<N;i++) {
    long long x;cin >> x;
    if (i==0) {
      A[0][0]=1LL;
      if (x!=0) count=0LL;
    }
    else {
      long long y=0LL;bool tuika=false;
      for (int j=0;j<3;j++) {
        if (A[j][i-1]==x) {
          y++;
          if (!tuika) {
            A[j][i]=A[j][i-1]+1LL;
            tuika=true;
          }
          else A[j][i]=A[j][i-1];
        }
        else A[j][i]=A[j][i-1];
      }
      count*=y;
      count=count%base;
    }
  }
  cout << count << endl;
}

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

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

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

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = 1<<30;
const ll mod = 1000000007LL;

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

int main() {
    int N;
    cin>>N;
    vector<int> A(N);
    rep(i,N) cin>>A[i];
    map<int,int> m;
    m[0]=3;
    ll ans = 1;
    rep(i,N){
        ans = (ans*m[A[i]])%mod;
        m[A[i]]--;
        m[A[i]+1]++;
    }
    cout<<ans<<endl;
}


#include <iostream>
using namespace std;
int main(void){
    long long n,a,min=1000000,max=-1000000,s=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;
        if(a>max)max=a;
        if(a<min)min=a;
        s=s+a;
    }
    cout<<min<<" "<<max<<" "<<s<<endl;
}

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

int main(){
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a,a+3);
    int Ans = a[0]+a[1];
    cout << Ans << endl;

}


#include <cstdio>
#include <algorithm>
using namespace std;
#define INF (1<<27)
int cost[100][100];
int main() {
	int n,k;
	while(scanf("%d %d",&n,&k),n) {
		fill((int*)cost,(int*)(cost+100),INF);
		for(int i=0;i<k;i++) {
			int a,b,c;
			scanf("%d",&a);
			if(a==0) {
				scanf("%d %d",&a,&b);
				if(cost[a-1][b-1]==INF)
					printf("-1\n");
				else
					printf("%d\n",cost[a-1][b-1]);
			}else {
				scanf("%d %d %d",&a,&b,&c);
				if(cost[a-1][b-1]>c) {
					cost[a-1][b-1]=cost[b-1][a-1]=c;
					for(int k=0;k<n;k++) {
						for(int i=0;i<n;i++) {
							for(int j=0;j<n;j++) {
								cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j]);
							}
						}
					}
				}
			}
		}
	}
}

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

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
const int inf = 1e9;

int n, k;
vector<P> vec[101];
int d[101];

void dijkstra(int s){
		pq<P, vector<P>, greater<P> > q;
		q.push(mk(0, s));
		d[s] = 0;
		while(!q.empty()){
				P p = q.top(); q.pop();
				int at = p.second;
				int dis = p.first;
				if(d[at] < dis)continue;
				for(auto itr = vec[at].begin(); itr != vec[at].end(); ++itr){
						int to = (*itr).second;
						int cost = (*itr).first;
						if(d[to] > dis + cost){
								d[to] = dis + cost;
								q.push(mk(d[to], to));
						}
				}
		}
}

int main(int argc, char const* argv[])
{
	do{
			cin >> n >> k;
			for(int i = 0; i < n; i++){
					vec[i].erase(vec[i].begin(), vec[i].end());
			}
			for(int i = 0; i < k; i++){
					int a;
					cin >> a;
					if(a == 0){
							int b, c;
							cin >> b >> c;
							b--; c--;
							fill(d, d+n, inf);
							dijkstra(b);
							if(d[c] == inf)cout << -1 << endl;
							else cout << d[c] << endl;
					}else{
							int b, c, dd;
							cin >> b >> c >> dd;
							b--; c--;
							vec[b].pb(mk(dd, c));
							vec[c].pb(mk(dd, b));
					}
			}
	}while(n != 0);
	return 0;
}


#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 1e9;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
/* struct P {
	int x, y, n;
	P(int n, int x, int y):n(n), x(x), y(y){}
	P(){}
}; */

/** Problem0207 : Block **/
int main()
{
	int W, H;

	while (cin>>W>>H, W||H) {
		vector<vector<int> > board(W, vector<int>(H));
		int sx, sy, gx, gy;
		cin>>sx>>sy>>gx>>gy;
		sx--, sy--, gx--, gy--;

		int N; cin>>N;
		while (N--) {
			int c, d, x, y; cin>>c>>d>>x>>y;
			x--, y--;

			if (d==0) {
				board[x][y] = board[x+1][y] = board[x+2][y] = board[x+3][y] = c;
				board[x][y+1] = board[x+1][y+1] = board[x+2][y+1] = board[x+3][y+1] = c;
			} else {
				board[x][y] = board[x][y+1] = board[x][y+2] = board[x][y+3] = c;
				board[x+1][y] = board[x+1][y+1] = board[x+1][y+2] = board[x+1][y+3] = c;
			}
		}

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

		queue<P> Q;
		bool vis[100][100]={0};
		Q.push(P(sx, sy));
		vis[sx][sy]=true;

		while (Q.size()) {
			P p = Q.front(); Q.pop();
			if (p.first == gx && p.second == gy) {
				cout << "OK" << endl;
				goto end;
			}
			rep(i, 4) {
				int nx = p.first+dx[i], ny = p.second+dy[i];
				if_range(nx, ny, W, H) {
					if (!vis[nx][ny] && board[nx][ny] == board[p.first][p.second]) {
						Q.push(P(nx, ny));
						vis[nx][ny] = true;
					}
				}
			}
		}
		cout << "NG" << endl;
	end:;
	}
}

#include <stdio.h>
const int INF=2147483647;
struct segment_tree{
    int map[2000010];
    void build(int now,int l,int r){
        if(l==r){
            map[now]=INF;
            return;
        }
        map[now]=-1;
        int mid=(l+r)/2;
        build(now*2+1,l,mid);
        build(now*2+2,mid+1,r);
        return ;
    }
    void change(int n,int now,int L,int R,int l,int r){
        if(R<l||L>r)return;
        if(L>=l&&R<=r){
            map[now]=n;
            return;
        }
        if(map[now]!=-1){
            map[now*2+1]=map[now*2+2]=map[now];
            map[now]=-1;
        }
        int mid=(L+R)/2;
        change(n,now*2+1,L,mid,l,r);
        change(n,now*2+2,mid+1,R,l,r);
        return ;
    }
    int find(int now,int L,int R,int n){
        if(L==R)return map[now];
        if(map[now]!=-1){map[now*2+1]=map[now*2+2]=map[now];
            int temp=map[now];
            map[now]=-1;
            return temp;
        }
        int mid=(L+R)/2;
        if(mid>=n)return find(now*2+1,L,mid,n);
        else return find(now*2+2,mid+1,R,n);
    }
};
int main(){
    int n,m,k,l,r;
    segment_tree arr;
    scanf("%d%d",&n,&m);
    arr.build(0,0,n-1);
    while(m--){
        scanf("%d",&k);
        if(k==0){
            scanf("%d%d%d",&l,&r,&k);
            arr.change(k,0,0,n-1,l,r);
        }
        else {
            scanf("%d",&k);
            printf("%d\n",arr.find(0,0,n-1,k));
        }
    }

}


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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n,h,w; cin>>n>>h>>w;
	cout<<(n-h+1)*(n-w+1)<<endl;
	return 0;
}

/*************************************
 * problem:      AT2164 Rabbit Exercise.
 * user ID:      63720.
 * user name:    Jomoo.
 * time:         2019-08-14.
 * language:     C++.
 * upload place: Luogu.
*************************************/

#include <bits/stdc++.h>
using namespace std;
#define puts_return(x) { puts(x); return 0; }
#define write_return(x) { write(x); return 0; }

typedef signed char          int8;
typedef unsigned char       uint8;
typedef short                int16;
typedef unsigned short      uint16;
typedef int                  int32;
typedef unsigned            uint32;
typedef long long            int64;
typedef unsigned long long  uint64;

template <typename Int>
inline Int read()
{
    Int flag = 1;
    char c = getchar();
    while ((!isdigit(c)) && c != '-') c = getchar();
    if (c == '-') flag = -1, c = getchar();
    Int init = c & 15;
    while (isdigit(c = getchar())) init = (init << 3) + (init << 1) + (c & 15);
	return init * flag;
}

template <typename Int>
inline void write(Int x)
{
    if (x < 0) putchar('-'), x = ~x + 1;
    if (x > 9) write(x / 10);
    putchar((x % 10) | 48);
}

template <typename Int>
inline void write(Int x, char nextch)
{
    write(x);
    putchar(nextch);
}

uint64 n, m, k;
vector<int32> x, a, to, ans;
vector<bool> vis;

int main()
{
    n = read<uint64>();
    x.resize(n);
    to.resize(n);
    ans.resize(n);
    vis.resize(n);
    for (size_t i = 0; i < n; i++) x[i] = read<int32>(), to[i] = i;
    for (size_t i = n - 1; i > 0; i--) x[i] -= x[i - 1];
    m = read<uint64>();
    a.resize(m);
    k = read<uint64>();
    for (auto num : a) num = read<int32>(), swap(to[num], to[num - 1]);
    for (size_t i = 0; i < n; i++)
        if (!vis[i]) {
            vector<int32> s;
            for (int j = i; !vis[j]; j = to[j]) s.push_back(j), vis[j] = true;
            for (size_t j = 0; j < s.size(); j++) ans[s[j]] = x[s[(j + k) % s.size()]];
        }
    // ans[0] = x[0];
    // ans[n - 1] = x[n - 1];
    int64 tot = 0;
    for (auto answer : ans) write(tot += answer, 10);
    return 0;
}


#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

int a,b,c;

signed main(){
	read(a,b,c);
	a=max(a,b);
	write(c/a+(c%a>0));
}

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

typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define MP make_pair
#define MT make_tuple
#define F first
#define S second
#define PB push_back
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((ll)(x).size())
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define ps(s) cout << #s << endl;
#define pv(v) cout << (v) << endl;
#define pvd(v) cout << setprecision(16) << (v) << endl;
#define ALL(a)  (a).begin(),(a).end()
#define RANGE(a, start_index, num)  (a).begin()+(start_index),(a).begin()+(num)

int main() {
	int h, w, n;
	cin >> h >> w >> n;
	int tmp = max(h, w);
	n += tmp - 1;
	int res = n / tmp;
	pv(res)
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int arr[55], pref[55];
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) {
        cin >> arr[i];
        pref[i] = arr[i] +  pref[i - 1];
    }
    int answer = -2e9;
    int sum1 = 0;
    for (int i = 0; i <= n; ++i) {
        int sum2 = 0;
        for (int j = i + 1; j <= n + 1; ++j) {
            if (i + n - j + 1 <= k) {
                multiset<int> l, r;
                for (int x = 1; x <= i; ++x) {
                    if (arr[x] < 0) {
                        l.insert(arr[x]);
                    }
                }
                for (int x = n; x >= j; --x) {
                    if (arr[x] < 0) {
                        r.insert(arr[x]);
                    }
                }
                int sum1 = 0;
                auto p1 = l.begin();
                for (int x = 0; x <= l.size(); ++x) {
                    if (x > 0) {
                        sum1 += *p1;
                        ++p1;
                    }
                    int sum2 = 0;
                    auto p2 = r.begin();
                    for (int y = 0; y <= r.size(); ++y) {
                        if (y > 0) {
                            sum2 += *p2;
                            ++p2;
                        }
                        if (x + y <= k - (i + n - j + 1)) {
                            answer = max(answer, pref[i] + pref[n] - pref[j - 1] - sum1 - sum2);
                        }
                    }
                }
            }
        }
    }
    cout << answer;
}

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

typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define dump(x)  cout << #x << " = " << (x) << endl;	//debug
#define SZ(x) ((ll)(x).size())
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define ps(s) cout << #s << endl;
#define pv(v) cout << (v) << endl;
#define pvd(v) cout << setprecision(16) << (v) << endl;
#define ALL(a)  (a).begin(),(a).end()
#define RANGE(a, start_index, num)  (a).begin()+(start_index),(a).begin()+(num)

int main() {
	int n, k;
	cin >> n >> k;
	deque<ll> d;
	FOR(i, 1, n) {
		int v;
		cin >> v;
		d.push_back(v);
	}
	ll res = 0;
	int lim = min(k, n);
	FOR(i, 0, lim) {
		FOR(j, 0, i) {
			deque<ll> d2 = d;
			vector<ll> jw;
			FOR(left, 1, j) {
				jw.push_back(d2.front());
				d2.pop_front();
			}
			FOR(right, 1, i - j) {
				jw.push_back(d2.back());
				d2.pop_back();
			}
			sort(ALL(jw));
			FOR(index, 0, k - i - 1) {
				if (index <= i - 1 && jw[index] < 0) {
					jw[index] = 0;
				}
			}
			ll tmp = accumulate(ALL(jw), 0LL);
			res = max(res, tmp);
		}
	}

	pv(res)
}


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

bool nabeatsu(int n){
    if(n % 3 == 0) return true;
    int temp = n;
    while(temp > 0){
        if(temp % 10 == 3) return true;
        temp /= 10;
    }
    return false;
}
int main(){
    int n; cin >> n;
    for(int i = 1; i <= n; i++){
        if(nabeatsu(i)){
            cout << ' ' << i;
        }
    }
    cout << endl;
}

#include <iostream>
#include <vector>

using namespace std;

int powerOf2(int n)	{
	int res = 0;
	while (n % 2 == 0)	{
		res++;
		n /= 2;
	}
	return res;
}

int main()	{
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)	{
		cin >> a[i];
	}
	int pow2 = 1e9;
	for (int i = 0; i < n; i++)	{
		pow2 = min(pow2, powerOf2(a[i]));
	}
	cout << pow2 << endl;
	return 0;
}


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

using namespace std;

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

	if (S.length() == 3) {
		reverse(S.begin(), S.end());
		cout << S << endl;
	}
	else {
		cout << S << endl;
	}
}

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

#define all(v) v.begin(), v.end()

const ll mod=1000000007;

ll countBits(ll in){
  int res=0;
  for(;in>0;in>>=1){
    if((in&0x01)!=0){
      res++;
    }
  }
  return res;
}

template<typename T>
void show2dVector(vector<vector<T>>& v){
  for(int i=0;i<v.size();i++){
    int m=v[i].size();
    cout<<i<<" : ";
    for(int j=0;i<m;i++){
      cout<<v[i][j]<<" ";
    }
    cout<<endl;
  }
}

void bfs(const vector<vector<int>>&g, int v, vector<bool>& seen){
  seen[v]=true;
  cout<<v<<" ";
  for(auto next: g[v]){
    if(seen[next]){
      continue;
    }
    bfs(g,next,seen);
  }
}

bool dfs(vector<vector<int>> &g,int start,int goal,vector<bool>&seen){
  bool res=false;
  seen[start]=true;
  if(start==goal){
    return true;
  }
  for(auto next: g[start]){
    if(seen[next]){
      continue;
    }
    res=dfs(g,next,goal,seen);
    if(res){
      break;
    }
  }
  return res;
}

ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}

char toLowerCase(char c){
  if(isLowerCase(c)){
    return c;
  }else{
    return c+'a'-'A';
  }
}
char toUpperCase(char c){
  if(isLowerCase(c)){
    return c-('a'-'A');
  }else{
    return c;
  }
}
ll powm(ll a,ll n, ll m){
  ll ret=1;
  while(n>0){
    if(n%2==1){
      ret=(ret*a)%m;
    }
    n>>=1;
    a=(a*a)%m;
  }
  return ret;
}

const string yesno(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  string n;cin>>n;
  if(n.size()==3){
    char c=n[0];
    n[0]=n[2];
    n[2]=c;
  }
  cout<<n<<endl;
  return 0;
}


//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}

string str;
int n, k;
ll dp[305][305][305];

int main(){
	cin >> str;
	n = str.size();
	cin >> k; chmin(k, n);
	dp[0][0][0] = 1;
	for(int i=0;i<n;i++){
		int pre = n-1-i;
		while(pre >= 0 && str[pre] == '1') pre--;

		rep(j, i+1){
			rep(all, k+1){
				if(dp[i][j][all] == 0) continue;
				if(str[n-1-i] == '0'){
					//0 & 0
					add(dp[i+1][j+1][all], dp[i][j][all]);
					//0 & 1
					if(i > j){
						add(dp[i][j+1][all], dp[i][j][all]);
					}
				}
				else{
					//1 & 0
					if(pre != -1 && all+n-1-i-pre <= k) add(dp[n-pre][j+1][all+n-1-i-pre], dp[i][j][all]);
					//1 & 1
					add(dp[i+1][j+1][all], dp[i][j][all]);
				}
			}
		}
	}
	//cout << dp[2][1][1] << endl;
	ll ans = 0;
	rep(j, n+1) rep(i, k+1) ans += dp[n][j][i];
	cout << (ans%mod) << endl;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

const int N=605;

int n,d1,d2;
bool vis[N][N];

bool fill(int d) {
	int t=0;
	for(;!(d&3);d>>=2) t++;
	if ((d&3)==1) fo(i,0,n-1) fo(j,0,n-1) vis[i][j]|=((i>>t)+(j>>t))&1;
	else fo(i,0,n-1) fo(j,0,n-1) vis[i][j]|=(i>>t)&1;
}

int main() {
	scanf("%d",&n);n<<=1;
	scanf("%d%d",&d1,&d2);fill(d1);fill(d2);
	int m=n*n>>2;
	fo(i,0,n-1) fo(j,0,n-1)
		if (!vis[i][j]) {
			printf("%d %d\n",i,j);
			if (!(--m)) return 0;
		}
	return 0;
}


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

#define debug(x) cout << #x << " = " << x << endl;
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define FOR(it, b, e) for (typeof(b) it = (b); it != (e); ++it)
#define MSET(c, v) memset(c, v, sizeof(c))

const int INF = 0x3F3F3F3F;
const int NEGINF = 0xC0C0C0C0;
const int NULO = -1;
const double EPS = 1e-10;
const ll mod = 1e9 + 7;

inline int cmp(double x, double y = 0)
{
  if(fabs(x - y) < EPS)
    return 0;
  return x > y ? 1 : -1;
}

ll exp(ll a, ll b)
{
  ll ans = 1;
  while(b)
  {
    if(b & 1)
      ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}

const int maxn = 1005;

vector<int>graph[maxn];

vector<int>ans;
int n,m;
int vis[maxn];
void dfs(int u, int target)
{
  vis[u] = 1;
  for(const auto &v: graph[u])
  {
    if(vis[v] == 1)
    {
      if(v == target)
      {
        vector<int>cycle;
        for(int i = 1; i <= n ; i++)
          if(vis[i] == 1)
            cycle.push_back(i);
        if(ans.size() == 0 || cycle.size() < ans.size())
          ans = cycle;
      }
    }
    else if(vis[v] == 0)
    {
      dfs(v, target);
    }
  }
  vis[u] = 2;
}

int main()
{
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for(int i = 0 ; i < m ; i++)
  {
    int u,v;
    cin >> u >> v;
    graph[u].push_back(v);
  }
  for(int i = 1 ; i <= n ; i++)
  {
    MSET(vis, 0);
    dfs(i, i);
  }

  if(ans.size() == 0)
    cout << "-1\n";
  else
  {
    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++)
    {
      cout << ans[i] << endl;
    }
  }
  return 0;
}

#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>

int main(){
  int N, Q; cin >> N >> Q;
  string S; cin >> S;
  int c[N];
  c[0] = 0;
  rep(i,N-1) {
    if (S.substr(i,2)=="AC") c[i+1] = 1;
    else c[i+1] = 0;
  }
  rep(i,N){
    if (i==0) continue;
    else c[i] += c[i-1];
  }

  rep(q,Q){
    int l, r;
    cin >> l >> r;
    cout << c[r-1] - c[l-1] << endl;
  }

  // cout << fixed << setprecision(10);

  return 0;
}


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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;

void Main() {
  ll n;
  cin >> n;
  vll a(n), ans(n, 0);

  REP(i, n) {
    cin >> a[i];
  }

  REPD(i, n) {
    ll total = 0;
    ll index = i + 1; // 3, 2, 1
    FOR(j, 2, n) {
      if (index * j <= n) {
        total += ans[index * j - 1];
      }
      else {
        break;
      }
    }
    if (total % 2 == 0) {
      ans[index - 1] = a[index - 1];
    }
    else {
      if (a[index - 1] == 0) {
        ans[index - 1] = 1;
      }
      else {
        ans[index - 1] = 0;
      }
    }
  }

  ll count=0;
  vll ball_list;
  REP(i, n) {
    if (ans[i] == 1) {
      ball_list.pb(i + 1);
      count++;
    }
  }
  COUT(count);
  if (ball_list.size()) {
    COUTA(i, ball_list);
  }

}

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

/*
5 2
3 1 2 5
2 2 3
1 0
*/

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 2e5 + 5;
int n;
int a[N];
int cnt[N];
int res;

int main() {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }
    for (int i = n; i >= 1; --i) {
        int Cnt = 0;
        for (int j = i + i; j <= n; j += i) {
            Cnt += cnt[j];
        }
        Cnt %= 2;
        if (a[i] != Cnt) {
            ++res;
            cnt[i] = 1;
        }
    }
    cout << res << endl;
    for (int i = 1; i <= n; ++i) {
        if (cnt[i]) {
            cout << i << ' ';
        }
    }
    if (res)
        cout << endl;
    return 0;
}


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  int N, M;
  cin >> N >> M;
  int max = 0;
  if(M%N == 0){
    cout << M / N <<endl;
    return 0;
  }
  for(int i = 1; i <= M/N; i++){
    if(M % i == 0 && M % i <= N){
      max = i;
    }
  }
  cout << max <<endl;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline bool chmin(A &a,const B &b){if(a>b){a=b;return true;}else{return false;}}
template<typename A,typename B>inline bool chmax(A &a,const B &b){if(a<b){a=b;return true;}else{return false;}}

int main()
{
    ll x,y;
    cin >> x >> y;
    ll A = abs(abs(x)-abs(y));
    ll B = 0;
    if(( x>0 && y>0 )||( x<0 && y<0 )){
        if((x>0 && abs(x) > abs(y)) || (x<0 && abs(x) < abs(y)))B = 2;
    }else{
        B=1;
        if((x<0 && y==0) || (x==0 && y>0))B = 0;
    }
    cout << (A+B) << endl;
}


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

bool chk(int bit, vector<vector<P>> &p)
{
    bool result = true;

    for (int i = 0; i < (int)p.size(); i++)
    {
        if (!(bit & (1 << i)))
        {
            continue;
        }

        for (int j = 0; j < (int)p[i].size(); j++)
        {
            int tx = p[i][j].first;
            int ty = p[i][j].second;

            if ((ty == 1 && (bit & (1 << tx))) ||
                (ty == 0 && (~bit & (1 << tx))))
            {
                continue;
            }
            else
            {
                result = false;
            }
        }
    }

    return result;
}

int main()
{
    int n;
    int a;
    vector<vector<P>> p;
    int cnt = 0, ans = 0;

    // 入力
    cin >> n;
    p.resize(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        p[i].resize(a);
        for (int j = 0; j < a; j++)
        {
            cin >> p[i][j].first >> p[i][j].second;
            --p[i][j].first;
        }
    }

    // 処理
    for (int bit = 0; bit < (1 << n); bit++)
    {
        if (chk(bit, p))
        {
            cnt = 0;
            for (int i = 0; i < n; i++)
            {
                if (bit & (1 << i))
                    cnt++;
            }
            ans = max(ans, cnt);
        }
    }

    // 出力
    cout << ans << endl;

    return 0;
}

#ifdef __GNUC__
#pragma GCC target("avx2")
#pragma GCC optimize ("O20")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC optimize("unroll-loops")
#define iss std::cin
#endif
#include "bits/stdc++.h"
#define rep(i, times) for(ll i = 0; i < (times); ++i)
#define p(x) (cout << x << "\n")
using ll = long long; using ld = long double; using namespace std;

#ifndef __GNUC__
string text =
R"X(
2
1
2 0
1
1 0
)X";
stringstream iss{text};
#endif

class HonestOrUnkind2
{
	ll N{0};
	vector<bool> h;//正直かどうかの仮定
	vector<vector<ll>> s;//証言
	void inp( ) {
		iss >> N;
		h.resize(N);
		s.resize(N, vector<ll>(N, 3));//3:言及せず 0:不親切呼ばわり 1:正直者認定
		rep(n, N) {
			ll K; iss >> K;//証言個数
			rep(k, K) {
				ll p, hn; iss >> p >> hn;//p番目の人は(n番が言うには)正直か
				s[n][--p] = hn;
			}
		}
	}
	inline bool consistentQ( ) {//仮定と矛盾しないかだけ調べる
		for (ll n = 0; n < N; ++n) {
			if (!h[n]) continue; //不親切なら無視
			for (ll p = 0; p < N; ++p) {//n番目の人がp番目の人に対して証言
				if (s[n][p] == 3) continue;
				if ((s[n][p] == 1) && !h[p]) return false;
				if ((s[n][p] == 0) && h[p]) return false;
			}
		}
		return true;
	}
	void changeSeikaku( ) {
		size_t NH{0}; // 正直者の最大人数
		const ll maxB{(1 << N)};
		for (ll b = 0; b < maxB; ++b) {//全員の状態を変える
			rep(n, N) { h[n] = (b >> n) & 1; }//n番の人が正直と仮定したか
			if (consistentQ( )) NH = max(NH, bitset<32>(b).count( ));
		}
		p(NH);
	}
public:
	void procedures( ) {
		inp( );
		changeSeikaku( );
	}
};

int main( ) {
	cin.tie(0);	ios::sync_with_stdio(0);
	class HonestOrUnkind2 a; a.procedures( );
}


#include<stdio.h>
int main()
{
	int N,R,A;
	scanf("%d %d", &N, &R);
	A =100*(10-N);
	if(N>=10){
		printf("%d", R);
	}
	else{
		printf("%d", R + A);
	}
return 0;
}

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

int main() {
  int a=0,b=0;

  cin >> a;
  cin >> b;

  cout << 2 * b - a << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using vi  = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;

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

  rep(i, 1<<3) {
    bitset<3> bit(i);
    int sum = abcd[0] - '0';
    string ans = "";
    ans += abcd[0];
    rep(j, 3) {
      if (bit[j] == 0) {
        sum += abcd[j+1] - '0';
        ans += "+";
        ans += abcd[j+1];
      }
      else {
        sum -= abcd[j+1] - '0';
        ans += "-";
        ans += abcd[j+1];
      }
    }
    if (sum == 7) {
      ans += "=7";
      cout << ans << endl;
      return 0;
    }
  }
}


#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair

int main(void)
{
    cin.sync_with_stdio(false);
    string str;
    while(cin >> str){
        reverse(ALL(str));
        cout << str << endl;
    }

    return 0;
}

#include<iostream>
#include<string.h>

using namespace std;

int main(){
        char str [21];

        cin >> str;

        for(int i = strlen(str)-1; i >= 0; i--){
                cout << str[i];
        }
        cout << endl;
}


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

const int N = 110;

char str[N];

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> str;
	int len = strlen(str);
	str[len - 8] = 0;
	cout << str << "\n";

	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(){
    string S;
    cin>>S;
    rep(i,S.size()-1){
        if(S.at(i)=='A'){
            if(S.at(i+1)=='C'){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
return 0;}
/*compile
g++ code.cpp
./a.out
run*/
/*
int f(int x){
    int y=int((x*x+4.0)/8.0);
    return y;
}
*/


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long   ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define mem(a,h)          memset(a, (h), sizeof(a))
#define fi first
#define se second
#define por(a,b) (((a%MOD) * (b%MOD))%MOD)
#define forg(i, b, e, c)    for (ll i = (ll)b; i < (ll)e; i+=c)
#define forr(i, b, e)    for (ll i = b; i < e; i++)

using namespace std;
using namespace __gnu_pbds;
typedef double lldb;
typedef pair<ll, ll>  ii;
typedef pair<ll, ii>  iii;
typedef vector<ll>     vi;
typedef vector<vi>     vvi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = 1e9;
const double PI = acos(-1);
#define offset
const ll MOD= 1e9+7;
#define initseg ll new_nodo=(nodo*2),mid=(iz+der)/2;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define tam 223455
ll D;
ll m;
map<ll,ll> ways;
ll vexp[tam],pot[tam];
ll f(ll pos,ll D2)
{
    if (pos==m)
    {
        return (D2==D);
    }
    ll formas=0;
    ll maxx=-9,minn=9;
    forr(delt,-9,10)
    {
        if (D2+vexp[pos]*delt<=D)
            maxx=delt;
        if (D2+vexp[pos]*delt>D)
            minn=min(minn,delt);
    }
    formas+=f(pos+1,minn*vexp[pos]+D2)*ways[minn];
    if (maxx!=minn)
    formas+=f(pos+1,maxx*vexp[pos]+D2)*ways[maxx];
    return formas;
}
ll go(ll digs)
{
    m=(digs/2);
    //cout<<digs<<' '<<m<<": ";
    forr(i,0,m)
    {
        vexp[i]=(pot[digs-1-i]-pot[i]);
        //cout<<vexp[i]<<" ";
    }
    //cout<<endl;
    ll total=0;
    forr(i,-9,10)
    {
        total+=f(1,vexp[0]*i)*(ways[i]-1);
        //cout<<total<<" "<<i<<' '<<ways[i]-1<<endl;
    }
    if (digs%2==1)
        total= total*10;
        return total;
}
int  main()
{
    forr(i,0,10)
    {
        forr(j,0,10)
        {
            ways[i-j]++;
        }
    }

    pot[0]=1;
    forr(i,1,19)
        pot[i]=pot[i-1]*10;
    cin>>D;
    ll formas=0;
    forr(digs,2,19)
    {
        formas+=go(digs);
        //cout<<formas<<'\n';
    }
    cout<<formas<<endl;
}
// PLUS ULTRA!ac

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
//#define f(i,a,n) for(ll i=a;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll isPrime(int n)
{
	// Corner cases
	if (n <= 1)
		return 1;
	if (n <= 3)
		return 2;

	// This is checked so that we can skip
	// middle five numbers in below loop
	if (n % 2 == 0 || n % 3 == 0)
		return 1;

	for (int i = 5; i * i <= n; i = i + 6)
		if (n % i == 0 || n % (i + 2) == 0)
			return 1;

	return 2;
}

ll fact(ll n){ll res = 1;for (ll i = 2; i <= n; i++)res = res * i,res%=1000000007;
    return res; }

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

ll findlcm(ll arr[], int n)
{

    ll ans = arr[0];

    for (int i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}

int main()
{
    fast;
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll n,sum=0;
        cin>>n;
        ll A[n];
        map<ll,ll>B;
        for(ll i=0;i<n;i++)
        {
            cin>>A[i];
            B[A[i]]++;

        }
      sort(A,A+n);
        for(ll i=0;i<n;i++)
        {
            sum=sum+(B[A[i]]%2);
          i=i+B[A[i]]-1;
        }
        cout<<sum;
    }
    return 0;
}