#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <iostream>

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

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

    int T;
    cin >> T;
    int ans[100];
    REP(i, T) {
        string S;
        cin >> S;
        ans[i] = -1;
        if ("atcoder" < S)
            ans[i] = 0;
        else{
            REP(j, S.length())
            {
                if(S[j] > 'a') {
                    if(S[j] > 't')
                        ans[i] = j-1;
                    else
                        ans[i] = j;
                    break;
                }
            }
        }

    }
    REP(i,T)
    cout << ans[i] << "\n";
}
#include <bits/stdc++.h>
using namespace std;
#define maxn 200010
#define md 998244353
#define ll long long
int dp[maxn][30];
constexpr int top = 300000;
vector<int> fac(top + 1), ifac(top + 1);
inline int add(int a, int b) {
    a += b;
    if (a >= md) a -= md;
    return a;
}

inline int sub(int a, int b) {
    a -= b;
    if (a < 0) a += md;
    return a;
}

inline int mul(int a, int b) {
    return (int)((long long)a * b % md);
}

inline int powmod(int a, long long b) {
    int res = 1;
    while (b > 0) {
        if (b & 1) res = mul(res, a);
        a = mul(a, a);
        b >>= 1;
    }
    return res;
}

inline int inv(int a) {
    a %= md;
    if (a < 0) a += md;
    int b = md, u = 0, v = 1;
    while (a) {
        int t = b / a;
        b -= t * a; swap(a, b);
        u -= t * v; swap(u, v);
    }
    assert(b == 1);
    if (u < 0) u += md;
    return u;
}
int binom(int n, int m) {
    if (n < m || n < 0 || m < 0) return 0;
    return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

void init() {
    fac[0] = 1;
    for (int i = 1; i <= top; i++) fac[i] = mul(fac[i - 1], i);
    ifac[top] = inv(fac[top]);
    for (int i = top; i; i--) ifac[i - 1] = mul(ifac[i], i);
}
int main() {
    int n, m;
    scanf("%d%d", &n, &m);
    init();
    dp[0][0] = 1;
    for (int i = 1; i < 20; i++) dp[0][i] = 1;
    for (int i = 1; i <= m; i++) {
        for (int j = 0; j < 20; j++) {
            for (int k = 0; k * (1 << j) <= i && k <= n; k += 2) {
                dp[i][j + 1] = add(dp[i][j + 1], mul(dp[i - k * (1 << j)][j], binom(n, k)));
            }
        }
    }
    int ans = 0;
    //for(int i=0;i<18;i++) ans=add(ans,dp[m][i]);
    printf("%d\n", dp[m][19]);
    return 0;
}
