from collections import defaultdict mod = 998244353 N, M, K = map(int, input().split()) pows = [(K + 1) ** i for i in range(N + 1)] g = [[] for _ in range(N)] for _ in range(M): u, v = map(int, input().split()) u -= 1 v -= 1 g[u].append(v) g[v].append(u) dp = [[0] * N for _ in range(pows[N])] for i in range(N): dp[pows[i]][i] = 1 for i in range(pows[N]): for u in range(N): x = (i // pows[u]) % (K + 1) if 0 < x: for v in g[u]: y = (i // pows[v]) % (K + 1) if y < K: dp[i + pows[v]][v] += dp[i][u] dp[i + pows[v]][v] %= mod ans = 0 for i in range(N): ans += dp[pows[N] - 1][i] ans %= mod print(ans)