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 fi first
#define se second
#define SZ(x) ((int)x.size())
#define lowbit(x) x&-x
#define pb push_back
#define ALL(x) (x).begin(),(x).end()
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin())
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define LEN(x) strlen(x)
#define MS0(x) memset((x),0,sizeof((x)))
#define Rint register int
#define ls (u<<1)
#define rs (u<<1|1)
typedef unsigned int unit;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<pii> Vpii;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(ll &x) { scanf("%lld", &x); }
void _R(ull &x) { scanf("%llu", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const ll &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.fi);putchar(' '); _W(x.se);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int MOD=998244353,mod=998244353;
ll qpow(ll a,ll b) {ll res=1;a%=MOD; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
const int MAXN=4e5+10,MAXM=4e6+10;
const int INF=INT_MAX,SINF=0x3f3f3f3f;
const ll llINF=LLONG_MAX;
const int inv2=(MOD+1)/2;
const int Lim=1<<20;

int dpsz;
struct Matrix
{
    ll a[200][200];
    Matrix operator * (const Matrix &rhs)const
    {
        Matrix res;
        memset(res.a,0,sizeof(res.a));
        for(int i=0;i<dpsz;i++)
            for(int j=0;j<dpsz;j++)
                for(int k=0;k<dpsz;k++)
                (res.a[i][j]+=a[i][k]*rhs.a[k][j])%=MOD;
        return res;
    }
    void print()
    {
        for(int i=1;i<=dpsz;i++,W(""))
            for(int j=1;j<=dpsz;j++)
            printf("%lld ",a[i][j]);
    }
};
Matrix ksm(Matrix x,int v)
{
    Matrix res;
    memset(res.a,0,sizeof(res.a));
    for(int i=0;i<=dpsz;i++)res.a[i][i]=1;
    while(v)
    {
        if(v&1)(res=res*x);
        x=x*x;
        v>>=1;
    }
    return res;
}

int n,m;
map<pii,int> mp;
char s[MAXN];
int ch[MAXN][30],endpos[MAXN],tot;
void ins()
{
    int u=0,p=LEN(s);
    for(int i=0;i<p;i++)
    {
        if(ch[u][s[i]-'a']==-1)ch[u][s[i]-'a']=++tot;
        u=ch[u][s[i]-'a'];
    }
    endpos[u]=1;
}
queue<pii> q;
int getmp(int u,int v)
{
    if(u>v)swap(u,v);
    if(!mp[{u,v}])
    {
        mp[{u,v}]=++dpsz;
        q.push({u,v});
    }
    return mp[{u,v}];
}

Matrix trans,form;
int outedge[MAXN];
void solve()
{
    R(n,m);
    memset(ch,-1,sizeof(ch));
    for(int i=1;i<=n;i++)
    {
        R(s);ins();
    }
    getmp(0,0);
    while(!q.empty())
    {
        int u,v;
        tie(u,v)=q.front();q.pop();
        int ini=getmp(u,v);
        for(int i=0;i<26;i++)
        {
            int pu=ch[u][i],pv=ch[v][i];
            if(pu==-1||pv==-1)continue;
            int tq=getmp(pu,pv);
            trans.a[ini][tq]++;
            if(endpos[pu]&&endpos[pv])trans.a[ini][1]++;
            if(endpos[pv])trans.a[ini][getmp(pu,0)]++;
            if(endpos[pu])trans.a[ini][getmp(pv,0)]++;
        }
    }
    for(int i=1;i<=dpsz;i++)
        for(int j=1;j<=dpsz;j++)outedge[i]+=trans.a[i][j];
    Vi vec;
    for(int i=1;i<=dpsz;i++)if(outedge[i])vec.pb(i);
    for(int i=0;i<SZ(vec);i++)
        for(int j=0;j<SZ(vec);j++)
        form.a[i][j]=trans.a[vec[i]][vec[j]];
    dpsz=SZ(vec);
    assert(dpsz<=150);
    form=ksm(form,m);
    W(form.a[0][0]);
}

int main()
{
    int T=1;
    //scanf("%d",&T);
    for(int kase=1;kase<=T;kase++)
    {
        //printf("Case #%d: ",kase);
        solve();
    }
    return 0;
}