N, M, K = map(int, input().split()) G = [[] for _ in range(N)] for _ in range(M): u, v = map(int, input().split()) G[u-1].append(v-1) G[v-1].append(u-1) MOD = 998244353 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 j in range(N): if dp[i][j] >= 1: for v in G[j]: if i//((K+1)**v)%(K+1) < K: dp[i+((K+1)**v)][v] += dp[i][j] dp[i+((K+1)**v)][v] %= MOD print(sum(dp[-1])%MOD)