n,m,t = map(int, input().split()) graph = [[] for i in range(n)] for i in range(m): a, b = map(int, input().split()) graph[a].append(b) graph[b].append(a) mod = 998244353 ans = [0]*n ans[0] = 1 for _ in range(t): ans_copy = ans.copy() for to in range(n): ans[to] = 0 for fr in graph[to]: ans[to] += ans_copy[fr] ans[to] %= mod print(ans[0])