DIV = 998244353 N,M,T = map(int,input().split()) G = [[] for i in range(N)] for _ in range(M): s,t = map(int,input().split()) G[s].append(t) G[t].append(s) dp = [0] * N dp[0] = 1 for _ in range(T): new_dp = [0] * N for s in range(N): for t in G[s]: new_dp[s] += dp[t] new_dp[s] %= DIV dp = new_dp print(dp[0])