from collections import defaultdict N, M, T = map(int, input().split()) graph = defaultdict(list) for _ in range(M): s, t = map(int, input().split()) graph[s].append(t) graph[t].append(s) cnt = [0] * N new_cnt = [0] * N cnt[0] = 1 mod = 998244353 while T > 0: new_cnt = [0] * N for s in range(N): for t in graph[s]: new_cnt[t] += cnt[s] new_cnt[t] %= mod cnt, new_cnt = new_cnt, cnt T -= 1 print(cnt[0])