#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 998244353//1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef  long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef ll ValType;
template<typename  T> void maxtt(T& t1, T t2) {
    t1=max(t1,t2);
}
template<typename  T> void mintt(T& t1, T t2) {
    t1=min(t1,t2);
}
#define MAX (135)

bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
const ll MOD2 = (ll)MOD * (ll)MOD;
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD){
    x+=y; if (x>=mod) x-=mod;
    if(x<0) x+=mod;
    assert(x>=0 && x<mod);
}
void et(int x=-1) {
    printf("%d\n", x); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) {
    return y?gcd1(y,x%y):x;
}

//#include <atcoder/all>
//using mint = atcoder::modint1000000007;

string S[10];
int tr[50][26],cnt=1, ed[50*26];
void add(int id) {
    int N=S[id].size();
    int rt=1;
    for(int i=0;i<N;i++) {
        int c=S[id][i]-'a';
        if (tr[rt][c]==0) tr[rt][c]=++cnt;
        rt=tr[rt][c];
    }
    ed[rt]=id;
}
struct Matrix {
    int n,m;
    vector<vector<int>> a;
    Matrix() { }
    Matrix(int n, int m) : n(n), m(m) {
        a.resize(n, vector<int>(m));
    }
    void init(int num) {
        REP(i,n)REP(j,m)a[i][j]=num;
    }
    
    Matrix operator*(Matrix b) {
        Matrix o = Matrix(n, b.m);
        for(int i=0;i<n;i++) {
            for(int j=0;j<b.m;j++) {
                o.a[i][j]=0;
                for(int k=0;k<m;k++) {
                    addmod(o.a[i][j], (ll)a[i][k] * b.a[k][j] % MOD);
                }
            }
        }
        return o;
    }
    Matrix pow(ll p) {
        Matrix o = Matrix(n,m);
        Matrix b = *this;
        for(int i=0;i<n;i++)for(int j=0;j<m;j++) o.a[i][j] = (i==j);
        while(p>0) {
            if (p&1) o=o*b;
            b=b*b; p>>=1;
        }
        return o;
    }
};
map<pii,int> mp;
int mpi;
queue<pii> q;
int gid(int x, int y) {
    if(x>y) swap(x,y);
    if (mp.find({x,y}) == mp.end()) {
        mp[{x,y}]=mpi++;
        q.push({x,y});
    }
    return mp[{x,y}];
}
int A[200][200];
void fmain(int tid) {
    scanf("%d%d", &n, &m);
    REQ(i,n) cin>>S[i];
    REQ(i,n) add(i);
    gid(1,1);
    while (!q.empty()) {
        auto [x,y]=q.front();
        q.pop();
        int id=gid(x, y);
        REP(j,26) {
            int X=tr[x][j],Y=tr[y][j];
            if(X==0||Y==0) continue;
            A[id][gid(X, Y)]++;
            if(ed[X]) A[id][gid(1, Y)]++;
            if(ed[Y])A[id][gid(X, 1)]++;
            if(ed[X]&&ed[Y]) {
                A[id][gid(1, 1)]++;
            }
        }
    }
    Matrix mt=Matrix(mpi, mpi);
    REP(i,mpi)REP(j,mpi)mt.a[i][j]=A[i][j];
    Matrix B=mt.pow(m);
    printf("%d\n",B.a[0][0]);
}
int main() {
//    freopen("in21.txt","r",stdin);
   // freopen("output.txt","w",stdout);
    int t=1;
//    init();
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}
