N,M,K = map(int,input().split()) mod = 998244353 E = [[0 for j in range(N)] for i in range(N)] for i in range(M): u,v = map(int,input().split()) u -= 1 v -= 1 E[u][v] = 1 E[v][u] = 1 dp = [[0 for i in range(N)] for i in range((K+1)**N)] for i in range(N): dp[(K+1)**i][i] = 1 for s in range((K+1)**N): p = [0 for i in range(N)] b = s for i in range(N): p[i] = b % (K + 1) b //= K + 1 for now in range(N): for nex in range(N): if E[now][nex]: if p[nex] == K: continue ss = s + (K+1)**nex dp[ss][nex] += dp[s][now] dp[ss][nex] %= mod ans = 0 for i in range(N): ans += dp[-1][i] ans %= mod print(ans)