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:
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include <cstring>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=(ll) a; i<(ll) b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 500000000LL
#define EPS 0.00000001
#define pi 3.14159
ll mod=998244353LL;

template<class A=ll> 
void Out(vector<A> a) {REP(i,0,a.size()) {cout<<a[i]<<" ";} cout<<endl;}

template<class A=ll>
void In(vector<A> &a, ll N) {A cur; REP(i,0,N) {cin>>cur; a.pb(cur);}} 

bool suf(string a, string b)
{
	if(a.size()>b.size()) {swap(a,b);}
	REP(i,0,a.size()) {if(a[a.size()-i-1]!=b[b.size()-i-1]) {return false;}}
	return true;
}

string dif(string a, string b)
{
	if(a.size()>b.size()) {swap(a,b);}
	string ans=""; REP(i,0,b.size()-a.size()) {ans+=b[i];}
	return ans;
}

vector<vector<ll> > dp;
vector<vector<pl> > rec;

ll f(ll x, ll w)
{
	if(x<0LL || w<0LL) {return 0LL;}
	if(dp[x][w]>=0) {return dp[x][w];}
	ll ans = 0LL;
	REP(i,0,rec[w].size())
	{
		ans+=f(x-rec[w][i].ss,rec[w][i].ff);
	}
	dp[x][w]=ans;
	return ans;
}

class Matrix
{
    public:
    ll N,M; 
    vector<vector<ll> > a;
    ll rank; 
    Matrix *Red, *Inv, *Trans; double det;
    vector<bool> pivot;
    
    Matrix() {N=0LL; M=0LL; Red=nullptr; Inv=nullptr; Trans=nullptr;}
    Matrix (vector<vector<ll> > x)
    {
        N=x.size(); M=x[0].size(); a=x; rank=0LL; REP(i,0,M) {pivot.pb(false);}
        Red=nullptr; Inv=nullptr; Trans=nullptr;
    }
    
    Matrix operator + (Matrix B) //O(NM)
    {
        if((*this).N!=B.N || (*this).M!=B.M) {Matrix ANS; return ANS;}
        vector<vector<ll> > ans; vector<ll> xx; REP(i,0,(*this).M) {xx.pb(0);} REP(i,0,(*this).N) {ans.pb(xx);}
        REP(i,0,(*this).N) {REP(j,0,(*this).M) {ans[i][j]=(*this).a[i][j]+B.a[i][j];}}
        Matrix ANS(ans); return ANS;
    }
    
    Matrix operator * (Matrix B) //O(N^3)
    {
        if(M!=B.N) {Matrix ANS; return ANS;}
        vector<vector<ll> > d; vector<ll> xx; REP(i,0,B.M) {xx.pb(0);} REP(i,0,N) {d.pb(xx);}
        REP(i,0,N)
        {
            REP(j,0,B.M)
            {
                ll sum=0; REP(z,0,M) {sum+=(a[i][z]*B.a[z][j]); sum%=mod;}
                d[i][j]=sum;
            }
        }
        Matrix ANS(d);
        return ANS;
    }
    
    Matrix operator * (double c) //O(NM)
    {
        Matrix ANS = (*this); REP(i,0,N) {REP(j,0,M) {ANS.a[i][j]*=c; ANS.a[i][j]%=mod;}}
        return ANS;
    }
    
    Matrix operator - (Matrix B)
    {
        return ((*this)+B*(-1.0));
    }
    
    bool operator ==(Matrix B)
    {
        return ((*this).a==B.a);
    }
    
    bool operator !=(Matrix B)
    {
        if((*this)==B) {return false;}
        else {return true;}
    }
	
	Matrix operator ~() 
    {
        if(Trans!=nullptr) {return *Trans;} 
        vector<ll> xx; REP(i,0,N) {xx.pb(0.0);} 
        vector<vector<ll> > ans; REP(i,0,M) {ans.pb(xx);}
        REP(i,0,M) {REP(j,0,N) {ans[i][j]=a[j][i];}}
        Matrix *RESULT = new Matrix(ans); Trans=RESULT;
        return *RESULT;
    }
};

Matrix fastexp(Matrix A, ll e) //O(N^3loge)
{
    if(A.N!=A.M) {Matrix ANS; return ANS;}
    if(e==0) 
    {Matrix ANS=A; REP(i,0,A.N) {REP(j,0,A.N) {if(i!=j) {ANS.a[i][j]=0;} else {ANS.a[i][j]=1;}}} return ANS;}
    if(e%2LL==0)
    {
        Matrix V =fastexp(A,(ll) e/2LL); return (V*V);
    }
    else
    {
        Matrix V=fastexp(A,(ll) e/2LL); return (V*V*A);
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll N,M; cin>>N>>M;
	unordered_map<string,ll> m;
	vector<string> key;
	vector<string> s; In(s,N);
	string str;
	key.pb(""); m[""]=0LL;
	REP(i,0,N)
	{
		str="";
		REP(j,0,s[i].size())
		{
			str+=s[i][j];
			if(m.find(str)==m.end()) {key.pb(str); m[str]=key.size()-1;}
		}
	}
	ll K = key.size();
	vector<pl> xx; REP(i,0,K) {rec.pb(xx);}
	REP(i,0,K)
	{
		str = key[i];
		REP(j,0,N)
		{
			if(!suf(s[j],str)) {continue;}
			rec[i].pb({m[dif(s[j],str)],min(str.size(),s[j].size())});
		}
	}
	vector<ll> xxx; REP(i,0,K) {xxx.pb(-1LL);} REP(i,0,5) {dp.pb(xxx);}
	dp[0][0]=1LL; 
	REP(i,0,5) {REP(j,0,K) {dp[i][j]=f(i,j);}}
	vector<ll> v; REP(i,0,5*K) {v.pb(dp[i/K][i%K]);}
	vector<vector<ll> > Mat; xxx.clear(); REP(i,0,5*K) {xxx.pb(0LL);} REP(i,0,5*K) {Mat.pb(xxx);}
	REP(i,0,4*K) {Mat[i][i+K]=1LL;}
	vector<pl> newrec;
	REP(i,0,rec[0].size())
	{
		ll l = rec[0][i].ss; ll ind = rec[0][i].ff;
		REP(j,0,rec[ind].size())
		{
			newrec.pb({rec[ind][j].ff,rec[ind][j].ss+l});
		}
	}
	rec[0]=newrec;
	REP(i,0,K)
	{
		REP(j,0,rec[i].size())
		{
			ll gr = 4LL-rec[i][j].ss;
			ll ind = rec[i][j].ff;
			Mat[4*K+i][gr*K+ind+K]++;
		}
	}
	Matrix MAT(Mat); Matrix V({v}); 
	Matrix ANS = fastexp(MAT,M)*(~V);
	ll ans = ANS.a[0][0];
	ans=ans%mod; if(ans<0) {ans+=mod;}
	cout<<ans<<endl;
    return 0;
}