from collections import defaultdict
mod = 998244353

N, M, K = map(int, input().split())
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((K + 1) ** N)]
for i in range(N):
	dp[(K + 1) ** i][i] = 1

for i in range((K + 1) ** N):
	for u in range(N):
		x = (i // ((K + 1) ** u)) % (K + 1)
		if 0 < x:
			for v in g[u]:
				y = (i // ((K + 1) ** v)) % (K + 1)
				if y < K:
					dp[i + (K + 1) ** v][v] += dp[i][u]
					dp[i + (K + 1) ** v][v] %= mod

ans = 0
for i in range(N):
	ans += dp[(K + 1) ** N - 1][i]
	ans %= mod
print(ans)