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) P = 998244353 C = (K + 1) ** N dp = [[0] * N for _ in range(C)] for i in range(N): dp[(K + 1) ** i][i] = 1 m = [(K + 1) ** i for i in range(N)] for bit in range(C): dat = [0] * N b = bit for i in range(N): dat[i] = b % (K + 1) b //= (K + 1) for i in range(N): for v in G[i]: if dat[v] + 1 <= K: dp[bit + m[v]][v] += dp[bit][i] dp[bit + m[v]][v] %= P ans = 0 for i in range(N): ans += dp[-1][i] print(ans%P)