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;

#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int) x.size()
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define ROF(i, a, b) for(int i=(b-1); i>=(a); i--)
#define F0R(i, n) FOR(i, 0, n)
#define R0F(i, n) ROF(i, 0, n)
#define trav(x, y) for(auto&x:y)

using ll=long long;
using ld=long double;
using pii=pair<int, int>;
using pll=pair<ll, ll>;
using pli=pair<ll, int>;
using vi=vector<int>;
using vl=vector<ll>;
using vpii=vector<pii>;

template<class T> inline bool ckmin(T&a, const T&b) {return b<a?a=b,1:0;}
template<class T> inline bool ckmax(T&a, const T&b) {return b>a?a=b,1:0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const char nl='\n';
const int mxN=8;
const int AL=26;
const int MOD=998244353;
const int MAT=170;
const ll infLL=1e18;
const ld eps=1e-6;

struct node{
    int nxt[AL]; 
    bool fin=0; 
    node(){ memset(nxt, -1, sizeof nxt); fin=0; } 
    int&operator [](const int x){
        return nxt[x];
    }
};


struct mint {
    static const int mod = MOD;
    int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
    mint() { v = 0; }
    mint(ll _v) { v = int((-MOD < _v && _v < MOD) ? _v : _v % MOD);
        if (v < 0) v += MOD; }
    friend bool operator==(const mint& a, const mint& b) { 
        return a.v == b.v; }
    friend bool operator!=(const mint& a, const mint& b) { 
        return !(a == b); }
    friend bool operator<(const mint& a, const mint& b) { 
        return a.v < b.v; }
    mint& operator+=(const mint& m) { 
        if ((v += m.v) >= MOD) v -= MOD; 
        return *this; }
    mint& operator-=(const mint& m) { 
        if ((v -= m.v) < 0) v += MOD; 
        return *this; }
    mint& operator*=(const mint& m) { 
        v = int((ll)v*m.v%MOD); return *this; }
    mint& operator/=(const mint& m) { return (*this) *= inv(m); }
    friend mint pow(mint a, ll p) {
        mint ans = 1; assert(p >= 0);
        for (; p; p /= 2, a *= a) if (p&1) ans *= a;
        return ans; }
    friend mint inv(const mint& a) { assert(a.v != 0); 
        return pow(a,MOD-2); }
    mint operator-() const { return mint(-v); }
    mint& operator++() { return *this += 1; }
    mint& operator--() { return *this -= 1; }
    friend mint operator+(mint a, const mint& b) { return a += b; }
    friend mint operator-(mint a, const mint& b) { return a -= b; }
    friend mint operator*(mint a, const mint& b) { return a *= b; }
    friend mint operator/(mint a, const mint& b) { return a /= b; }
};

vector<mint> invs, fac, ifac; // make sure to convert to LL before doing any multiplications ...
void genFac(int SZ) {
    invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ); vi Invs(SZ);
    Invs[1] = 1; invs[1] = fac[0] = ifac[0] = 1; 
    FOR(i,2,SZ) Invs[i] = int(MOD-(ll)MOD/i*Invs[MOD%i]%MOD), invs[i] = mint(Invs[i]);
    FOR(i,1,SZ) {
        fac[i] = fac[i-1]*i;
        ifac[i] = ifac[i-1]*invs[i];
    }
}

mint choose(int n, int k) {
    if(k>n) return 0;
    return fac[n]*ifac[n-k]*ifac[k];
}

int n;
vector<node> trie;
map<pii, int> memo;

template<class T, int N> struct Mat{
    array<array<T, N>, N> d{};
    Mat operator*(const Mat& m) const{
        Mat a;
        F0R(i, N) F0R(j, N) F0R(k, N){
            a.d[i][j] += d[i][k]*m.d[k][j];
        }
        return a;
    };
    vector<T> operator*(const vector<T>& vec){
        vector<T> ret(N);
        F0R(i, N) F0R(j, N) ret[i] += d[i][j] * vec[j];
        return ret;
    };
    Mat operator^(ll p){
        Mat a, b(*this);
        F0R(i, N) a.d[i][i] = 1;
        while(p){
            if(p&1) a = a * b;
            b = b * b;
            p/=2;
        }
         return a;
    };
};

queue<pii> q;
Mat<mint, MAT> dp; 

int get(int x, int y){
    if(x>y) swap(x, y); 
    if(!memo.count({x, y})){
        int k=siz(memo); 
        memo[{x, y}]=k; 
        q.push({x, y});
    }
    return memo[{x, y}];
}

void add(const string&s){
    int cur=0;
    for(auto&c:s){
        if(trie[cur][c-'a']==-1){
            trie[cur][c-'a']=siz(trie); 
            trie.pb(node()); 
        }
        cur=trie[cur][c-'a'];
    }
    trie[cur].fin=1;
}


int m;

int32_t main(){
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> m;
    trie.pb(node()); 
    F0R(i, n){
        string s; cin >> s;
        add(s); 
    }
    // cout << "THIS" << endl;
    q.push({0, 0}); 
    memo[{0, 0}]=0; 
    while(!q.empty()){
        auto[u, v]=q.front(); q.pop(); 
        int x=get(u, v); 
        F0R(c, AL){
            if(trie[u][c]==-1||trie[v][c]==-1) continue;
            dp.d[x][get(trie[u][c], trie[v][c])]+=1; 
            if(trie[trie[u][c]].fin) dp.d[x][get(0, trie[v][c])]+=1; 
            if(trie[trie[v][c]].fin) dp.d[x][get(trie[u][c], 0)]+=1; 
            if(trie[trie[v][c]].fin&&trie[trie[u][c]].fin) dp.d[x][0]+=1; 
        }
    }
    auto v=dp^m;
    cout << v.d[0][0].v << nl;
}