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>

typedef long long ll;
typedef long long ull;

using namespace std;

const int mxN = 3e5+5;
const int mxK = 26;
const int mod = 998244353;

struct node
{
    int id;
    bool e;
    int mp[mxK];
    node(int _id)
    {
        id = _id;
        e = false;
        for(int i = 0; i < mxK; i++) mp[i] = -1;
    }
};
vector<node> trie;
void add(int x, int i, string& s)
{
    if(i == (int)s.size())
    {
        trie[x].e = true;
        return;
    }
    int key = s[i]-'a';
    if(trie[x].mp[key] == -1)
    {
        trie[x].mp[key] = trie.size();
        trie.push_back({(int)trie.size()});
    }
    add(trie[x].mp[key], i+1, s);
}

map<pair<int, int>, int> _index;
map<int, bool> vis;

bool exist(int u, int v)
{
    if(u < v) swap(u, v);
    return _index.find({u, v}) != _index.end();
}
int create(int u, int v)
{
    if(u < v) swap(u, v);
    int sz = _index.size();
    return _index[{u, v}] = sz;
}
int key(int u, int v)
{
    if(u < v) swap(u, v);
    if(exist(u, v))
    {
        return _index[{u, v}];
    }
    else
    {
        return create(u, v);
    }
}

struct matrix
{
    int k;
    vector<vector<ll>> a;
    matrix(int kk)
    {
        k = kk;
        a = vector<vector<ll>>(k);
        for(int i = 0; i < k; i++)
        {
            a[i] = vector<ll>(k, 0);
        }
    }

    void print()
    {
        for(int j = 0; j < k; j++)
        {
            for(int i = 0; i < k; i++)
            {
                cout << a[j][i] << " ";
            }
            cout << "\n";
        }
    }
};

matrix mul(matrix a, matrix b)
{
    int k = a.k;
    matrix ret(k);
    for(int i = 0; i < k; i++)
    {
        for(int j = 0; j < k; j++)
        {
            for(int q = 0; q < k; q++)
            {
                ret.a[i][q] = (ret.a[i][q] + a.a[i][j] * b.a[j][q]) % mod;
            }
        }
    }
    return ret;
}

matrix powb(matrix mat, ll x)
{
    int k = mat.k;
    matrix ret(k);
    for(int i = 0; i < k; i++) ret.a[i][i] = 1;
    while(x)
    {
        if(x&1)
        {
            ret = mul(mat, ret);
        }
        mat = mul(mat, mat);
        x >>= 1;
    }
    return ret;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    trie.push_back({0});
    int n; ll m; cin >> n >> m;
    for(int i = 0; i < n; i++)
    {
        string s; cin >> s;
        add(0, 0, s);
    }
    queue<pair<int, int>> q;
    q.push({0, 0}); /// nalazim se na 0 0
    create(0, 0);
    while(!q.empty())
    {
        auto pos = q.front(); q.pop();
        int u = pos.first, v = pos.second;
        ///probaj svaku tranziciju
        for(int k = 0; k < mxK; k++)
        {
            if(trie[u].mp[k] == -1 || trie[v].mp[k] == -1) continue;///nema
            int up = trie[u].mp[k], vp = trie[v].mp[k];
            if(!exist(up, vp))
            {
                create(up, vp);
                q.push({up, vp});
            }
            if(trie[up].e && !exist(0, vp))
            {
                create(0, vp);
                q.push({0, vp});
            }
            if(trie[vp].e && !exist(up, 0))
            {
                create(up, 0);
                q.push({up, 0});
            }
        }
    }
    int k = _index.size(); ///create matrix [k x k]
    matrix mat(k);
    q.push({0, 0});
    vis[key(0, 0)] = 1;
    while(!q.empty())
    {
        auto pos = q.front(); q.pop();
        int u = pos.first, v = pos.second;
        int x = key(u, v);
        ///probaj svaku tranziciju
        for(int k = 0; k < mxK; k++)
        {
            if(trie[u].mp[k] == -1 || trie[v].mp[k] == -1) continue;///nema
            int up = trie[u].mp[k], vp = trie[v].mp[k];
            mat.a[x][key(up, vp)]++;
            if(!vis[key(up, vp)])
            {
                vis[key(up, vp)] = 1;
                q.push({up, vp});
            }
            if(trie[up].e)
            {
                mat.a[x][key(0, vp)]++;
                if(!vis[key(0, vp)])
                {
                    vis[key(0, vp)] = 1;
                    q.push({0, vp});
                }
            }
            if(trie[vp].e)
            {
                mat.a[x][key(up, 0)]++;
                if(!vis[key(up, 0)])
                {
                    vis[key(up, 0)] = 1;
                    q.push({up, 0});
                }
            }
            if(trie[up].e && trie[vp].e)
            {
                mat.a[x][0]++;
            }
        }
    }
    mat = powb(mat, m);
    cout << mat.a[0][0];
}

/*
8 10000000
abcde
bcdef
cdefg
defga
efgab
fgabc
gabcd
a
*/