#include #include using namespace std; using namespace atcoder; using mint = modint998244353; int main() { int n, m, k; cin >> n >> m >> k; vector> g(n); for (int i = 0; i < m; i++) { int u, v; cin >> u >> v; u--; v--; g[u].push_back(v); g[v].push_back(u); } vector pows(n + 1); pows[0] = 1; for (int i = 1; i <= n; i++) { pows[i] = pows[i - 1] * (k + 1); } vector> dp(n, vector(pows[n])); for (int i = 0; i < n; i++) { dp[i][pows[i]] = mint(1); } for (int j = 0; j < pows[n]; j++) { for (int i = 0; i < n; i++) { int x = (j / pows[i]) % (k + 1); if (x == 0) { continue; } for (int ni : g[i]) { int y = (j / pows[ni]) % (k + 1); if (y < k) { dp[ni][j + pows[ni]] += dp[i][j]; } } } } mint ans = mint(0); for (int i = 0; i < n; i++) { ans += dp[i][pows[n] - 1]; } cout << ans.val() << endl; }