N = 2*10**5 mod = 998244353 g1 = [1]*(N+1) # 元テーブル g2 = [1]*(N+1) #逆元テーブル inverse = [1]*(N+1) #逆元テーブル計算用テーブル for i in range( 2, N + 1 ): g1[i]=( ( g1[i-1] * i ) % mod ) inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod ) g2[i]=( (g2[i-1] * inverse[i]) % mod ) inverse[0]=0 def cmb(n, r, mod): if ( r<0 or r>n ): return 0 r = min(r, n-r) return g1[n] * g2[r] * g2[n-r] % mod def fwt(n,A): assert len(A) == 2**n for i in range(n): t = 2**i for j in range(2**n): if j&t==0: A[j] += A[j|t] return A def ifwt(n,A): assert len(A) == 2**n for i in range(n): t = 2**i for j in range(2**n): if j&t==0: A[j] -= A[j|t] return A inv = pow(1024,mod-2,mod) def _fourier(f, inverse = False): f = f[:] n = (len(f) - 1).bit_length() for d in range(n): for U in range(1 << n): if not U >> d & 1: s, t = f[U], f[U | 1 << d] f[U], f[U | 1 << d] = (s + t)%mod, (s - t)%mod if inverse: f = [v *inv % mod for v in f] return f def convolution(f, g): return _fourier([a * b % mod for a, b in zip(_fourier(f), _fourier(g))], inverse = 1) import sys,random,bisect from collections import deque,defaultdict from heapq import heapify,heappop,heappush from itertools import permutations from math import log,gcd input = lambda :sys.stdin.readline() mi = lambda :map(int,input().split()) li = lambda :list(mi()) def mat_mul(X,Y): n,m = len(X),len(Y[0]) res = [[0 for j in range(m)] for i in range(n)] for i in range(n): for j in range(m): for k in range(len(Y)): res[i][j] += X[i][k] * Y[k][j] res[i][j] %= mod return res N,M,T = mi() A = [[0 for j in range(N)] for i in range(N)] for i in range(M): s,t = mi() A[s][t] = A[t][s] = 1 E = [[int(i==j) for j in range(N)] for i in range(N)] while T: if T&1: E = mat_mul(A,E) A = mat_mul(A,A) T >>= 1 ans = E[0][0] print(ans)