n,m,t = map(int,input().split()) l = [[] for _ in range(n)] for i in range(m): s,t = map(int,input().split()) l[s].append(t) l[t].append(s) rmd = [0] * n rmd[0] = 1 for i in range(t): new_rmd = [0] * n for node in range(n): for nd in l[node]: new_rmd[nd] += rmd[node] new_rmd[nd] %= 998244353 # print(new_rmd) rmd = new_rmd[::] print(rmd[0])