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