#include <bits/stdc++.h>
using namespace std;const int mod = 998244353;int n, m;int ch[50][26], ndcnt;int nxt[50], val[50], nc;map<int, int> mp[50];
void ins(string s) {int t = 0;for (auto i: s) {int c = i - 'a';if (!ch[t][c]) ch[t][c] = ++ndcnt;	t = ch[t][c];}++val[t];}
struct mat {int a[600][600];void output() {for (int i = 1; i <= nc; ++i)for (int j = 1; j <= nc; ++j)printf("%d%c", a[i][j], " \n"[j == nc]);}}v;
void adde(int l, int r, int w) {v.a[l][r] += w;v.a[l][r] %= mod;}
mat operator * (const mat &a, const mat &b) {mat ans;memset(ans.a, 0, sizeof ans.a);for (int i = 1; i <= nc; ++i)for (int k = 1; k <= nc; ++k)
			for (int j = 1; j <= nc; ++j) {	ans.a[i][j] += 1ll * a.a[i][k] * b.a[k][j] % mod;if (ans.a[i][j] >= mod) ans.a[i][j] -= mod;}return ans;}
mat fpow(mat x, int y) {mat ans;for (int i = 1; i <= nc; ++i)for (int j = 1; j <= nc; ++j)ans.a[i][j] = i == j;while (y) {if (y & 1) ans = ans * x;y >>= 1; x = x * x;}return ans;}
int dfs(int x, int y) {if (x > y) swap(x, y);int &p = mp[x][y];if (p == 0) p = ++nc;else return p;
	for (int i = 0; i < 26; ++i)if (ch[x][i] && ch[y][i]) {	int dx = ch[x][i], dy = ch[y][i];adde(p, dfs(0, 0), val[dx] * val[dy]);
			adde(p, dfs(dx, 0), val[dy]);adde(p, dfs(0, dy), val[dx]);adde(p, dfs(dx, dy), 1);}return p;}
int main() {scanf("%d%d", &n, &m);for (int i = 1; i <= n; ++i) {string s; cin >> s;ins(s);}dfs(0, 0);v = fpow(v, m);printf("%d", v.a[1][1]);}