n,m,T = map(int,input().split()) st = [[] for i in range(n)] mod = 998244353 for i in range(m): s,t = map(int,input().split()) st[s].append(t) st[t].append(s) ct = [0]*n ct[0] = 1 for i in range(T): nct = [0]*n for j in range(n): for k in st[j]: nct[j] += ct[k] nct[j] %= mod ct = nct[:] #print(ct) print(ct[0])