Problem: A chainword is a special type of crossword. As most of the crosswords do, it has cells that you put the letters in and some sort of hints to what these letters should be.

The letter cells in a chainword are put in a single row. We will consider chainwords of length m in this task.

A hint to a chainword is a sequence of segments such that the segments don't intersect with each other and cover all m letter cells. Each segment contains a description of the word in the corresponding cells.

The twist is that there are actually two hints: one sequence is the row above the letter cells and the other sequence is the row below the letter cells. When the sequences are different, they provide a way to resolve the ambiguity in the answers.

You are provided with a dictionary of n words, each word consists of lowercase Latin letters. All words are pairwise distinct.

An instance of a chainword is the following triple: 

  * a string of m lowercase Latin letters; 
  * the first hint: a sequence of segments such that the letters that correspond to each segment spell a word from the dictionary; 
  * the second hint: another sequence of segments such that the letters that correspond to each segment spell a word from the dictionary. 



Note that the sequences of segments don't necessarily have to be distinct.

Two instances of chainwords are considered different if they have different strings, different first hints or different second hints.

Count the number of different instances of chainwords. Since the number might be pretty large, output it modulo 998 244 353.

Input

The first line contains two integers n and m (1 ≤ n ≤ 8, 1 ≤ m ≤ 10^9) — the number of words in the dictionary and the number of letter cells.

Each of the next n lines contains a word — a non-empty string of no more than 5 lowercase Latin letters. All words are pairwise distinct. 

Output

Print a single integer — the number of different instances of chainwords of length m for the given dictionary modulo 998 244 353.

Examples

Input


3 5
ababa
ab
a


Output


11


Input


2 4
ab
cd


Output


4


Input


5 100
a
aa
aaa
aaaa
aaaaa


Output


142528942

Note

Here are all the instances of the valid chainwords for the first example: 

<image>

The red lines above the letters denote the segments of the first hint, the blue lines below the letters denote the segments of the second hint.

In the second example the possible strings are: "abab", "abcd", "cdab" and "cdcd". All the hints are segments that cover the first two letters and the last two letters.

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
#ifdef local
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
typedef long long ll;
#define f(i, l, r) for(int i=l;i<=r;i++)
#define rf(i, r, l) for(int i=r;i>=l;--i)
#define all(x) x.begin(),x.end()
const int N = 2e5+10, mod = 998244353;
ll power(ll a, ll b) {ll res = 1;while (b) {if (b & 1)res = res * a % mod;a = a * a % mod;b >>= 1;}return res;}
ll INV(ll a){return power(a,mod-2);}
mt19937 Rand(123456);
int Range(int l,int r){
    return l+Rand()%(r-l+1);
}

namespace linear_seq {
#define rep(i,a,n) for (int i=a;i<n;i++)
#define VI vector<int>
#define SZ(x) ((int)(x).size())
#define pb push_back
    const int N = 10010;
    ll res[N], base[N], _c[N], _md[N];
    vector<ll> Md;
    void mul(ll* a, ll* b, int k)
    {
        rep(i, 0, k + k) _c[i] = 0;
        rep(i, 0, k) if (a[i]) rep(j, 0, k) _c[i + j] = (_c[i + j] + a[i] * b[j]) % mod;
        for (int i = k + k - 1; i >= k; i--) if (_c[i])
                rep(j, 0, SZ(Md)) _c[i - k + Md[j]] = (_c[i - k + Md[j]] - _c[i] * _md[Md[j]]) % mod;
        rep(i, 0, k) a[i] = _c[i];
    }
    int solve(ll n, VI a, VI b)
    {
        ll ans = 0, pnt = 0;
        int k = SZ(a);
        assert(SZ(a) == SZ(b));
        rep(i, 0, k) _md[k - 1 - i] = -a[i]; _md[k] = 1;
        Md.clear();
        rep(i, 0, k) if (_md[i] != 0) Md.push_back(i);
        rep(i, 0, k) res[i] = base[i] = 0;
        res[0] = 1;
        while ((1ll << pnt) <= n) pnt++;
        for (int p = pnt; p >= 0; p--)
        {
            mul(res, res, k);
            if ((n >> p) & 1)
            {
                for (int i = k - 1; i >= 0; i--) res[i + 1] = res[i]; res[0] = 0;
                rep(j, 0, SZ(Md)) res[Md[j]] = (res[Md[j]] - res[k] * _md[Md[j]]) % mod;
            }
        }
        rep(i, 0, k) ans = (ans + res[i] * b[i]) % mod;
        if (ans < 0) ans += mod;
        return ans;
    }
    VI BM(VI s) {
        VI C(1, 1), B(1, 1);
        int L = 0, m = 1, b = 1;
        rep(n, 0, SZ(s)) {
            ll d = 0;
            rep(i, 0, L + 1) d = (d + (ll)C[i] * s[n - i]) % mod;
            if (d == 0) ++m;
            else if (2 * L <= n) {
                VI T = C;
                ll c = mod - d * power(b, mod - 2) % mod;
                while (SZ(C) < SZ(B) + m) C.pb(0);
                rep(i, 0, SZ(B)) C[i + m] = (C[i + m] + c * B[i]) % mod;
                L = n + 1 - L; B = T; b = d; m = 1;
            }
            else {
                ll c = mod - d * power(b, mod - 2) % mod;
                while (SZ(C) < SZ(B) + m) C.pb(0);
                rep(i, 0, SZ(B)) C[i + m] = (C[i + m] + c * B[i]) % mod;
                ++m;
            }
        }
        return C;
    }
    int gao(VI a, ll n) {
        VI c = BM(a);
        c.erase(c.begin());
        debug(c.size());
        rep(i, 0, SZ(c)) c[i] = (mod - c[i]) % mod;
        return solve(n, c, VI(a.begin(), a.begin() + SZ(c)));
    }
};
int dp[1700][1700];
vector<int> mat[1700];
struct Trie {
    int tr[N][26], tot;
    bool key[N];
    void insert(char* s) {
        int u = 0;
        for (int i = 1; s[i];i++) {
            int c = s[i] - 'a';
            if (tr[u][c] == 0)tr[u][c] = ++tot;
            u = tr[u][c];
        }
        key[u]=1;
    }
    int id(int x,int y){
        return y+x*(tot+1);
    }
    void build_mat(int m){
        f(u,0,tot)f(v,0,tot)f(w,0,25){
            if(tr[u][w]&&tr[v][w])mat[id(tr[u][w],tr[v][w])].push_back(id(u,v));
            if(tr[0][w]&&tr[v][w]&&key[u])mat[id(tr[0][w],tr[v][w])].push_back(id(u,v));
            if(tr[0][w]&&tr[u][w]&&key[v])mat[id(tr[u][w],tr[0][w])].push_back(id(u,v));
            if(tr[0][w]&&key[v]&&key[u])mat[id(tr[0][w],tr[0][w])].push_back(id(u,v));
        }
        int k=(tot+1)*(tot+1);

        vector<int> res,valid_id;
        f(i,0,tot)f(j,0,tot)if(key[i]&&key[j])valid_id.push_back(id(i,j));
        dp[0][0]=1;
        f(i,1,k) {
            f(j, 0, k)for(auto x:mat[j])dp[i][j] = (dp[i][j] + (ll) dp[i - 1][x]) % mod;
            ll ans=0;
            for(auto I:valid_id)ans+=dp[i][I];
            res.push_back(ans%mod);
        }
        printf("%lld\n", linear_seq::gao(res, m - 1) % mod);
    }
}T;
char s[N];
int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#ifdef local
    freopen("../in.txt", "r", stdin);
    clock_t beg=clock();
#endif
    int n,m;cin>>n>>m;
    f(i,1,n){
        cin>>s+1;
        T.insert(s);
    }
    T.build_mat(m);
    debug(clock()-beg);
}