N,M,T = map(int,input().split()) e = [[] for _ in range(N)] for _ in range(M): s,t = map(int,input().split()) e[s].append(t) e[t].append(s) k0 = [0]*N k1 = [0]*N mod = 998244353 k0[0] = 1 for i in range(T): k1 = [0]*N for j in range(N): for t in e[j]: k1[t] += k0[j] k1[t] %= mod k0 = list(k1) print(k0[0])